Skip to content
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: Added support for missing axios methods #19099

Merged
merged 13 commits into from
Mar 27, 2025

Conversation

Napalys
Copy link
Contributor

@Napalys Napalys commented Mar 24, 2025

This pull request introduces support for the previously missing axios methods and features:

  • postForm
  • putForm
  • patchForm
  • getUri
  • create
  • interceptors.request
  • interceptors.response

@Napalys Napalys force-pushed the js/axios_missing_methods branch from a2c7442 to 469cf56 Compare March 24, 2025 12:52
@Napalys Napalys marked this pull request as ready for review March 24, 2025 12:54
@Copilot Copilot bot review requested due to automatic review settings March 24, 2025 12:54
@Napalys Napalys requested a review from a team as a code owner March 24, 2025 12:54
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@Napalys Napalys force-pushed the js/axios_missing_methods branch from 387352f to 12b99ed Compare March 24, 2025 13:23
@Napalys Napalys requested a review from asgerf March 24, 2025 13:23
@Napalys Napalys force-pushed the js/axios_missing_methods branch from 12b99ed to 32e4c89 Compare March 24, 2025 16:58
@Napalys Napalys force-pushed the js/axios_missing_methods branch from 32e4c89 to 0689cf7 Compare March 25, 2025 09:56
@Napalys Napalys merged commit 261d28a into github:main Mar 27, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants