# Dependencies: from advisory match to reachable impact

Separate composition, advisory matching, runtime reachability, and exploit prerequisites so dependency reports describe product impact.

## Investigation sequence

1. Inventory layers
2. Resolve advisory
3. Trace consumer
4. Check prerequisites
5. Compare fixed behavior
6. Bound affected versions

## Used in these playbooks

[OSS & self-hosted](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/oss.html) · [Web & API](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/web-api.html) · [Desktop & extensions](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/desktop.html) · [Mobile](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/mobile.html) · [Cloud & containers](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/cloud.html) · [AI, agents & MCP](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/ai.html)

## Keep four questions separate

An SBOM answers what a tool identified in an artifact. An advisory matcher asks whether a component version matches known vulnerability data. Reachability asks whether the relevant implementation is used. Exploitability asks whether an attacker can satisfy the conditions and cross a security boundary. Preserve each conclusion independently; a negative result at one layer does not answer every other layer.

Inventory source locks, installed runtime, development/build dependencies, and final release output separately. A vulnerable parser in a lockfile may be absent from the production image. A development-only package may still run inside a privileged publisher. Record ecosystem, package identity, resolved version, origin, dependency path, optional features, and artifact digest. Use [CI and release analysis](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/modules/supply-chain-ci.html) for build impact and [source data flow](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/modules/source-dataflow.html) for runtime impact.

## Inventory and match locally

Examples require installed tools, reviewed inherited configuration, existing local paths, and prepared OSV ecosystem databases. They are command templates, not claimed results. `./release-root` means an already extracted, reviewed release tree.

```bash
mkdir -p ./evidence
syft dir:./repo -o cyclonedx-json=./evidence/source.cdx.json
syft dir:./release-root -o cyclonedx-json=./evidence/release.cdx.json
osv-scanner scan source --offline -r --format json \
  ./repo > ./evidence/osv-source.json
```

Syft supports directory inventory and structured SBOM output; detected composition depends on catalogers and available metadata. Compare the two inventories rather than assuming they represent the same execution environment. [Syft documentation](https://github.com/anchore/syft).

OSV source scanning uses supported manifests and lockfiles. Full `--offline` requires cached databases and avoids network activity; `--offline-vulnerabilities` has a narrower meaning and can permit other network features. Missing caches are an incomplete scan. Preserve database age and scanner stderr alongside findings. [OSV source scanning](https://google.github.io/osv-scanner/usage/scan-source), [offline behavior](https://google.github.io/osv-scanner/usage/offline-mode/).

## Build a reachability worksheet for each serious candidate

| Question | Concrete evidence | If unresolved |
|---|---|---|
| Is the resolved component affected? | Exact advisory range, vendored source, backport patch | Version match only |
| Is affected code present? | Release tree, build flags, linked module | Source-only candidate |
| Is the vulnerable API called? | Consumer call site and dynamic trace | Reachability unknown |
| Can an attacker control its argument? | Ordinary route/file/CLI input and transformations | No attacker path established |
| Are prerequisites satisfied? | Parser mode, operating system, feature, privilege | Conditional exposure |
| What changes across the boundary? | Synthetic output or bounded local fault | Impact unproven |

Hypothetical example: a document service ships an affected archive library, but the advisory concerns symbolic-link extraction. Trace upload acceptance → import job → actual extraction API → filter configuration → destination. A safe filter can defeat that specific path even when the version matcher is correct. Conversely, an optional compatibility flag may restore the unsafe behavior. Test supported configurations explicitly and reuse the [pinned lab](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/modules/oss-lab-reproduction.html).

## Check package origin as well as version

For dependency confusion, first inspect registry selection, namespace ownership, fallback, lockfiles, integrity hashes, and install hooks. pip documents that candidates from configured locations are considered together, rather than treating an extra index as a guaranteed lower-priority fallback. [pip install index behavior](https://pip.pypa.io/en/stable/cli/pip_install/).

Reproduce with two local registries and synthetic names that belong to your lab. Use packages containing metadata and harmless marker files; record which origin wins under the target's resolver configuration. Do not publish a real organization's missing package name. Resolver selection is one proof step; a product-impact claim must also show an affected build/consumer and applicable package controls.

## Control, report, and completion

Run the same smallest input against the affected and patched dependency in equivalent consumers. If swapping versions also changes application behavior or configuration, isolate that difference before crediting the patch. Test normal input to ensure the “fix” is not simply a broken integration. Avoid claiming every historical release is affected from one sampled version.

- [ ] Source, runtime, build, and release inventories are labeled.
- [ ] Advisory and patch are checked for the exact resolved component.
- [ ] Backports, vendoring, and optional features are considered.
- [ ] Attacker input reaches the affected API through supported use.
- [ ] Local impact and a fixed/control case are preserved.
- [ ] Tested versions, inferred exposure, and unknowns are separated.

The reporting threshold is a reproducible vulnerable use or the program's explicitly accepted dependency criterion. An old version number alone should remain a triage lead.

## Vulnerability reverse references

- [CI artifact poisoning across a workflow trust boundary](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/vulnerabilities/ci-artifact-poisoning.html) — A higher-trust workflow treats attacker-controlled test/build output as executable code or authoritative release input without adequate producer and content constraints.
- [Dependency confusion and unintended package origin](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/vulnerabilities/dependency-confusion.html) — Dependency resolution selects an attacker-controlled package origin where the build or application expects an organization-controlled package.
- [Out-of-bounds memory read](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/vulnerabilities/out-of-bounds-read.html) — A parser or native consumer reads outside the valid extent of an object or buffer, potentially causing a crash or disclosure depending on how the result is used.
- [Parser resource exhaustion and decompression amplification](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/vulnerabilities/parser-resource-exhaustion.html) — A small accepted input causes disproportionate CPU, memory, recursion, or expanded output consumption without effective limits at the relevant consumer.
