Detect dependency source redirection - #383
Conversation
013a79b to
b4b4f31
Compare
9e3e58d to
5040229
Compare
5040229 to
e7bad7a
Compare
a89cac0 to
ab60bb8
Compare
e7bad7a to
5a17cc3
Compare
|
Review comments taken up offline with Nir Paz and addressed in the PR. |
b523d10 to
be57557
Compare
|
Implemented the remaining findings from Nir's review
Validation: 85 dependency-source tests, 224 focused dependency/report/meta tests, 8 terminal/JSON/Markdown/SARIF end-to-end cases, and 2,316 repository tests passed; Ruff, focused mypy, and |
ab60bb8 to
4f1ecd7
Compare
6f490e2 to
66bc706
Compare
Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
66bc706 to
6b84b11
Compare
Summary
Add deterministic HIGH SC10 findings when package-manager configuration adds or replaces a dependency source, or when a dynamic destination cannot be resolved safely from simple local assignments.
The analyzer covers npm, Yarn, pip, Poetry, Maven, and Cargo across direct config files, commands/environment variables, generated heredoc configs, and actionable shell fences. It never executes configuration or contacts a registry.
Root cause
Existing generic patterns could notice credential/configuration-adjacent text but did not model package-source changes as dependency trust-boundary changes. A non-default registry or index could therefore affect dependency resolution without a dedicated rule, operation, scope, destination status, or package-manager evidence.
BEFORE behavior
For a published regression case that generates npm and Yarn configuration through a shell script:
AFTER behavior
The same case now emits two deterministic SC10 HIGH findings:
.npmrc.yarnrcThe destination is resolved through a same-file literal assignment and carried as structured, credential-safe evidence. The resulting combined assessment is 95 / CRITICAL / DO_NOT_INSTALL.
Supported surfaces
.npmrc, including scoped registriesnpm config set,NPM_CONFIG_REGISTRY.npmrcheredoc.yarnrc,.yarnrc.ymlyarn config setpip.conf,pip.inipip config set, index environment variablespyproject.tomlsourcespyproject.tomlheredocCommands in executable scripts and shell-language Markdown fences are actionable. Explanatory prose, comments, unrelated uses of the word “registry,” and non-shell fences do not create SC10 findings.
Deterministic decision model
unresolved.Evidence and credential safety
Each finding includes:
URL userinfo and sensitive query values are removed from SC10 findings. Report-level defense in depth applies the same redaction to every finding field and evidence string in terminal, JSON, Markdown, and SARIF output.
Validation
git diff --checkpassed.Review order
This PR is intentionally stacked on the nested-artifact PR so each change remains reviewable. After the first PR merges, this PR can be retargeted to
main; its own commit contains only SC10, credential redaction, tests, and documentation.Out of scope