C#: Blazor: Add non-local jump node for parameter passing#18930
C#: Blazor: Add non-local jump node for parameter passing#18930egregius313 wants to merge 11 commits intogithub:mainfrom
Conversation
csharp/ql/lib/semmle/code/csharp/frameworks/microsoft/aspnetcore/Components.qll
Fixed
Show fixed
Hide fixed
|
I am running into an issue here: as far as I can tell from locally testing the characteristic predicate and Update: It appears that changing them to share a variable fixed the issue (commit) |
96566b5 to
133c6fa
Compare
tamasvajk
left a comment
There was a problem hiding this comment.
I think you might be able to add a single line of code to the integration tests, and see if the flow is working there as well. You could add something like the below to the TestPage.razor:
<MyOutput Value="@QueryParam" />
and this should result in an XSS vulnerability.
| exists(NameOfExpr ne | ne = this.getArgument(1) | | ||
| result.getAnAccess() = ne.getAccess().(MemberAccess) | ||
| ) |
There was a problem hiding this comment.
Should this also work if instead of a nameof, the name of the property is directly referenced as a string literal?
csharp/ql/lib/semmle/code/csharp/frameworks/microsoft/aspnetcore/Components.qll
Outdated
Show resolved
Hide resolved
| @@ -0,0 +1 @@ | |||
| Security Features/CWE-079/XSS.ql No newline at end of file | |||
Check warning
Code scanning / CodeQL
Query test without inline test expectations Warning
| @@ -0,0 +1 @@ | |||
| Security Features/CWE-079/XSS.ql No newline at end of file | |||
Check warning
Code scanning / CodeQL
Query test without inline test expectations Warning
| @@ -0,0 +1 @@ | |||
| Security Features/CWE-079/XSS.ql No newline at end of file | |||
Check warning
Code scanning / CodeQL
Query test without inline test expectations Warning
|
I can't push to this branch, so continuing development in #19122. |
Establishes the pattern that when a variable is passed to a subcomponent, the reads of the set property are considered tainted.
For example, if in the following example
Nameswas tainted,Then a read in the
DisplayNamecomponent would be considered tainted