-
Notifications
You must be signed in to change notification settings - Fork 1.9k
JS: React-relay support #18858
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: React-relay support #18858
Conversation
a107b89 to
aea5fed
Compare
… as a source but isn't
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.
PR Overview
This pull request adds support for the react-relay library by introducing a new model that classifies specific react-relay hook return values as a "response" threat and extends test coverage for DOM-based XSS scenarios.
- Introduces a YAML file to model response threats for various react-relay hooks
- Adds corresponding test cases in a React component to validate DOM-based XSS alerts
- Updates change notes to document the new support for react-relay
Reviewed Changes
| File | Description |
|---|---|
| javascript/ql/lib/ext/react-relay-threat.model.yml | Adds model definitions for marking react-relay hook return values as "response" threats |
| javascript/ql/test/query-tests/Security/CWE-079/DomBasedXssWithResponseThreat/testReactRelay.tsx | Provides test cases for new response threat scenarios using react-relay hooks |
| javascript/ql/lib/change-notes/2025-02-25-react-relay.md | Notes the addition of react-relay support |
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Tip: Leave feedback on Copilot's review comments with the 👎 and 👍 buttons to help improve review quality. Learn more
...script/ql/test/query-tests/Security/CWE-079/DomBasedXssWithResponseThreat/testReactRelay.tsx
Show resolved
Hide resolved
Co-authored-by: Asgerf <asgerf@github.com>
asgerf
left a comment
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.
Excellent work!
This pull request introduces a library model for
react-relay's, categorizing it's new sources as aresponsethreat.Closes #465