Commit Graph

10445 Commits

Author SHA1 Message Date
github-actions[bot]
2de4a01c86 Release preparation for version 2.21.3 2025-05-13 21:14:27 +00:00
Asger F
169ae19015 Merge pull request #19391 from asgerf/js/typescript-path-resolution
JS: Overhaul import resolution
2025-05-13 15:46:38 +02:00
Asger F
aea676df3c Merge pull request #19445 from asgerf/js/summaries-with-fallback
JS: Generate flow summaries from summaryModels; only generate steps as a fallback
2025-05-13 14:49:38 +02:00
Napalys Klicius
d1e769ba54 Merge pull request #19422 from Napalys/js/shelljs
JS: Modeling of `ShellJS` functions
2025-05-02 14:18:44 +02:00
Napalys Klicius
871e93d9fe Update javascript/ql/lib/semmle/javascript/frameworks/ShellJS.qll
Co-authored-by: Asger F <asgerf@github.com>
2025-05-02 13:39:46 +02:00
Asger F
1f308ee47a JS: Explain use of monotonicAggregates 2025-05-02 13:22:27 +02:00
Asger F
5c9218fe5a JS: Add comment about 'path' heuristic 2025-05-02 13:22:25 +02:00
Asger F
f3e0cfd947 Apply suggestions from code review
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com>
2025-05-02 12:41:29 +02:00
Asger F
16fc8c3d9e JS: Benign test updates 2025-05-02 11:09:19 +02:00
Tamás Vajk
cb1c3736fe Merge pull request #19413 from tamasvajk/quality/query-suite-selector
Add code quality suite selector and use that in the code quality suites
2025-05-02 08:18:48 +02:00
Asger F
a44bdf3be2 JS: Generate summaries from summaryModel, and only generate steps as a fallback 2025-05-01 15:22:47 +02:00
Asger F
ca5f8b0c1d JS: Move some code into ModelsAsData.qll 2025-05-01 15:17:07 +02:00
Owen Mansel-Chan
e0549483fd Merge pull request #19429 from owen-mc/fix-cwe-tags-missing-leading-zero
Fix cwe tags to include leading zero
2025-05-01 14:09:54 +01:00
Owen Mansel-Chan
0863c87572 Add change notes 2025-05-01 10:33:24 +01:00
Napalys Klicius
68a9dd9f9e Address comments 2025-05-01 11:19:41 +02:00
Napalys Klicius
d4b5ef6a66 Refactor process.env handling in CleartextLogging and IndirectCommandInjection modules to use ThreatModelSource 2025-05-01 11:14:15 +02:00
Napalys Klicius
33d8ffa83e Added test cases for shelljs.env 2025-05-01 11:11:29 +02:00
Napalys Klicius
602500e280 Added change note 2025-05-01 11:09:56 +02:00
Napalys Klicius
40d176a770 Added model for shelljs.env 2025-05-01 11:09:47 +02:00
Owen Mansel-Chan
cf614a596d Fix cwe tags to include leading zero 2025-04-30 16:43:03 +01:00
Napalys Klicius
9624a413e4 Added change note 2025-04-30 14:57:00 +02:00
Napalys Klicius
71f1b82a56 Added support for fastify.all 2025-04-30 14:54:09 +02:00
Napalys Klicius
6d61766366 Added test case for fastify.all 2025-04-30 14:50:35 +02:00
Asger F
8ebbfb198e Merge pull request #19412 from asgerf/js/promise-all
JS: Better type-tracking through Promise.all()
2025-04-30 14:19:12 +02:00
Napalys Klicius
18cea2d6a5 Added support for shelljs.cmd and async-shelljs.asyncExec 2025-04-30 13:37:02 +02:00
Napalys Klicius
25d04f1cdd Added support for shelljs.which 2025-04-30 13:35:17 +02:00
Napalys Klicius
f6fae7ad60 Added test cases for cmd, which and asyncExec 2025-04-30 13:33:31 +02:00
Asger F
da5d799152 JS: Change note 2025-04-30 11:59:47 +02:00
Napalys Klicius
6de38b1827 Merge pull request #19300 from Napalys/js/fastify
JS: Added support for `fastify.addHook`
2025-04-29 18:32:25 +02:00
Tamas Vajk
d56c5225f6 Use code-quality-selectors in JS suite 2025-04-29 16:23:08 +02:00
Asger F
b0f73f1cbd JS: Update test output now that we import .d.ts files more liberally 2025-04-29 16:06:39 +02:00
Asger F
70a5ec5607 JS: Add package.json files in tests relying on node_modules
We don't extract node_modules folders by default so these tests aren't
that relevant anymore, and we no longer follow node_modules resolution
rules directly.

Instead, these imports are resolved based on the monorepo support which
simply requires a package.json file to exist. There is not a good enough
reason to support node_modules directly, so we're accepting some
minor regression in these tests.
2025-04-29 16:06:38 +02:00
Asger F
5de2c938d8 JS: Rename getTargetFile to getImportedFile and remove its deprecated name clash
'getTargetFile' was originally named to avoid the clash with 'getImportedFile' from a subclass. But we now just merge the two predicates.
2025-04-29 16:06:36 +02:00
Asger F
be5de9c080 JS: Update test output
path.resolve() and template expressions are now working.

Previously they could not be resolved because Import.getImportedPath() returned a PathExpr,
and these were not instances of PathExpr.
2025-04-29 16:06:35 +02:00
Asger F
eae1e1cb02 JS: Make API graphs rely on type-tracking steps in general 2025-04-29 15:08:19 +02:00
Asger F
e40b93b8a3 JS: Add type-tracking step through simple Promise.all() calls 2025-04-29 15:08:18 +02:00
Asger F
ed2a832a55 JS: Deprecate PathExpr and related classes 2025-04-29 13:23:47 +02:00
Asger F
fe055ad603 JS: Use PackageJsonEx instead of resolveMainModule 2025-04-29 13:23:45 +02:00
Asger F
c293f03b9e JS: Remove a dependency on getImportedPath()
To avoid negative recursion in some upcoming changes, we want to make sure the modeling of createRequire does not depend on getImportedPath().
2025-04-29 13:23:43 +02:00
Asger F
a195d074c9 JS: Resolve Angular2 templateUrl with ResolveExpr instead of PathExpr 2025-04-29 13:23:42 +02:00
Asger F
d724874969 JS: Implement babel-plugin-root-import as a PathMapping 2025-04-29 13:23:40 +02:00
Asger F
e4420f63fb JS: Move babel-root-import test
This moves the test for the babel `root-import` plugin into the new
unit test for import resolution, so we only have one set of tests to
maintain.

The actual implementation is added in the next commit.
2025-04-29 13:23:38 +02:00
Asger F
6725cb5b8c JS: Implement import resolution 2025-04-29 13:23:37 +02:00
Asger F
ed4864edf7 JS: Add two more helpers to FilePath class 2025-04-29 13:07:21 +02:00
Asger F
f542956f66 JS: Add internal extension of PackageJson class 2025-04-29 13:07:19 +02:00
Asger F
bb91df8145 JS: Add helper for doing path resolution with JS rules 2025-04-29 13:07:18 +02:00
Asger F
59e1cbcc7b JS: Add tsconfig class 2025-04-29 13:07:16 +02:00
Asger F
ef32a036b1 JS: Extract from methods from PathString into a non-abstract base class
The new class 'FilePath' has bindingset[this] so one just has to cast a string to that type and you can use its methods.
2025-04-29 13:07:15 +02:00
Asger F
17aa5220a6 JS: Add some helpers 2025-04-29 13:07:14 +02:00
Asger F
565cb434fc JS: Add test 2025-04-29 13:07:10 +02:00