JS: Added support for missing axios methods#19099
Merged
Napalys merged 13 commits intogithub:mainfrom Mar 27, 2025
Merged
Conversation
a2c7442 to
469cf56
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR extends axios support by adding new methods and interceptor features, along with corresponding test cases and model updates for security-related scenarios.
- Introduces axios interceptors for request and response to simulate SSRF and DOM-based XSS vulnerabilities in test files.
- Adds test cases for new axios methods including postForm, putForm, patchForm, getUri, and create.
- Updates the axios model and change notes to document the inclusion of these new features.
Reviewed Changes
Copilot reviewed 5 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| javascript/ql/test/experimental/Security/CWE-918/interceptors.js | Implements a request interceptor that replaces the URL with a user-supplied value (for SSRF test purposes). |
| javascript/ql/test/query-tests/Security/CWE-079/DomBasedXss/interceptors.js | Implements a response interceptor that injects response data into the DOM (for DOM-based XSS test purposes), but contains a use of an undeclared variable. |
| javascript/ql/lib/ext/axios.model.yml | Adds model definitions for the new axios interceptors. |
| javascript/ql/test/library-tests/frameworks/ClientRequests/tst.js | Adds tests covering the newly introduced axios methods and axios instance functionality. |
| javascript/ql/lib/change-notes/2025-03-24-axios-additional-methods.md | Updates documentation to reflect support for additional axios methods and interceptor features. |
Files not reviewed (5)
- javascript/ql/lib/semmle/javascript/frameworks/ClientRequests.qll: Language not supported
- javascript/ql/test/experimental/Security/CWE-918/SSRF.expected: Language not supported
- javascript/ql/test/library-tests/frameworks/ClientRequests/ClientRequests.expected: Language not supported
- javascript/ql/test/query-tests/Security/CWE-079/DomBasedXss/Xss.expected: Language not supported
- javascript/ql/test/query-tests/Security/CWE-079/DomBasedXss/XssWithAdditionalSources.expected: Language not supported
Tip: Copilot code review supports C#, Go, Java, JavaScript, Markdown, Python, Ruby and TypeScript, with more languages coming soon. Learn more
javascript/ql/test/query-tests/Security/CWE-079/DomBasedXss/interceptors.js
Outdated
Show resolved
Hide resolved
asgerf
reviewed
Mar 24, 2025
387352f to
12b99ed
Compare
12b99ed to
32e4c89
Compare
asgerf
reviewed
Mar 25, 2025
In particular for `postForm` `putForm` `patchForm` `getUri`.
Co-authored-by: Asger F <asgerf@github.com>
32e4c89 to
0689cf7
Compare
asgerf
approved these changes
Mar 27, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces support for the previously missing
axiosmethods and features:postFormputFormpatchFormgetUricreateinterceptors.requestinterceptors.response