-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C#: Blazor: Add non-local jump node for parameter passing #18930
base: main
Are you sure you want to change the base?
C#: Blazor: Add non-local jump node for parameter passing #18930
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Check warning
Code scanning / CodeQL
Query test without inline test expectations Warning
@@ -0,0 +1 @@ | |||
Security Features/CWE-079/XSS.ql |
Check warning
Code scanning / CodeQL
Query test without inline test expectations Warning
@@ -0,0 +1 @@ | |||
Security Features/CWE-079/XSS.ql |
Check warning
Code scanning / CodeQL
Query test without inline test expectations Warning
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
Names
was tainted,Then a read in the
DisplayName
component would be considered tainted