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: Modeling of mkdirp functions #19210

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

Napalys
Copy link
Contributor

@Napalys Napalys commented Apr 3, 2025

Added MaD for mkdirp functions which were not covered and converted old modeling of mkdirp to MaD.

@Napalys Napalys marked this pull request as ready for review April 4, 2025 13:26
@Copilot Copilot bot review requested due to automatic review settings April 4, 2025 13:26
@Napalys Napalys requested a review from a team as a code owner April 4, 2025 13:26
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 updates the CodeQL models to support additional mkdirp methods, adding a MaD for the previously uncovered functions and updating the test cases accordingly.

  • Added a new test file for mkdirp functions with multiple sink calls.
  • Extended the existing model to include a broader set of mkdirp method variants.
  • Updated change notes to document the new functionality.

Reviewed Changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated no comments.

File Description
javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/mkdirp.js Added test cases to verify taint propagation for various mkdirp methods
javascript/ql/lib/ext/mkdirp.model.yml Extended the model with additional mkdirp method variants as sinks
javascript/ql/lib/change-notes/2025-04-02-mkdirp.md Added a changelog entry documenting support for new mkdirp sinks
Files not reviewed (2)
  • javascript/ql/lib/semmle/javascript/frameworks/Files.qll: Language not supported
  • javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/TaintedPath.expected: Language not supported
Comments suppressed due to low confidence (2)

javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/mkdirp.js:8

  • Consider adding assertions following the mkdirp calls to verify that the expected taint propagation occurs, which would improve test coverage.
app.post('/foo', async (req, res) => {

javascript/ql/lib/ext/mkdirp.model.yml:6

  • [nitpick] Consider reordering the method names alphabetically to enhance clarity and maintainability of the model entry.
- ["mkdirp", "Member[nativeSync,native,manual,manualSync,mkdirpNative,mkdirpManual,mkdirpManualSync,mkdirpNativeSync,mkdirpSync,sync].Argument[0]", "path-injection"]

Tip: Copilot only keeps its highest confidence comments to reduce noise and keep you focused. Learn more

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.

1 participant