-
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
JS: Add Angular2 DOM sources #18458
base: main
Are you sure you want to change the base?
JS: Add Angular2 DOM sources #18458
Conversation
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.
Copilot reviewed 4 out of 8 changed files in this pull request and generated no comments.
Files not reviewed (4)
- javascript/ql/lib/semmle/javascript/DOM.qll: Language not supported
- javascript/ql/lib/semmle/javascript/frameworks/Angular2.qll: Language not supported
- javascript/ql/lib/semmle/javascript/security/dataflow/XssThroughDomCustomizations.qll: Language not supported
- javascript/ql/test/query-tests/Security/CWE-079/XssThroughDom/XssThroughDom.expected: Language not supported
Tip: If you use Visual Studio Code, you can request a review from Copilot before you push from the "Source Control" tab. Learn more
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.
👍
Optional comment about the tests.
} | ||
|
||
useField() { | ||
document.write(this.field); // NOT OK |
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.
maybe add a negative example?
Add a field name otherField
and test that it's safe.
Similarly a setOtherInput(..)
method where the parameter is safe to use.
Adds support for a few sources of form inputs and DOM objects coming from Angular:
$event
inside an Angular event handler as a source of DOM eventsNgForm.value
as a source of form input[(ngModel)]
two-way data binding as a source of form input