Skip to content

JS: Modeling of fastify #19439

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

Merged
merged 4 commits into from
May 1, 2025
Merged

JS: Modeling of fastify #19439

merged 4 commits into from
May 1, 2025

Conversation

Napalys
Copy link
Contributor

@Napalys Napalys commented May 1, 2025

Implements modeling of Fastify's all method which handles requests across all HTTP methods with a single route definition.

@Napalys Napalys marked this pull request as ready for review May 1, 2025 07:21
@Copilot Copilot AI review requested due to automatic review settings May 1, 2025 07:21
@Napalys Napalys requested a review from a team as a code owner May 1, 2025 07:21
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

Adds support for Fastify’s all method in both tests and the QL model so that routes registered with fastify.all are treated like any HTTP method.

  • Include a new fastify.all('/eval', …) test case and update expected results.
  • Extend Fastify.qll to recognize "all" in route setups and adapt getHttpMethod().
  • Document the addition in the change-notes.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
javascript/ql/test/query-tests/Security/CWE-094/CodeInjection/fastify.js Add fastify.all('/eval', …) scenario
javascript/ql/test/query-tests/Security/CWE-094/CodeInjection/HeuristicSourceCodeInjection.expected Update provenance edges/nodes for new test
javascript/ql/test/query-tests/Security/CWE-094/CodeInjection/CodeInjection.expected Update expected alerts/provenance for new test
javascript/ql/lib/semmle/javascript/frameworks/Fastify.qll Include "all" in RouteSetup and modify getHttpMethod()
javascript/ql/lib/change-notes/2025-04-30-fastify-all.md Add note about all route handler support

Copy link
Contributor

@asgerf asgerf left a comment

Choose a reason for hiding this comment

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

Minor nit otherwise LGTM

@Napalys Napalys requested a review from asgerf May 1, 2025 09:21
@Napalys Napalys merged commit 6ba0dc2 into github:main May 1, 2025
14 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