Dependencies that change during packaging
npm dependency whose runtime files are generated by its own prepack hook; the generator never ships
The application and how it is built
A Node application with one dependency, trace-route-package. The package's entry point is dist/index.js, but dist/ is not in the package's source. A prepack lifecycle script, scripts/generate-dist.js, writes it when the package is packed, and the script itself is left out of the tarball that gets installed.
What gets hidden, and how
npm runs a package's lifecycle scripts while the distributable is being made. What is installed can therefore differ from what is in the package's repository, and the code that made the difference never ships.
| Component | Mechanism | In the artefact? | What happens to it |
|---|---|---|---|
| trace-route-package@1.0.0 | prepack-generated | ships | the package is visible, but dist/index.js was written by scripts/generate-dist.js at pack time and is not in the package's source |
What a true SBOM would say
2 components ship, 1 of them transformed on the way in. 0 are known not to ship. Those influence the build or run during it; a tool may list them, as long as it marks them.
The list was written by hand from the build files, the lockfiles and the listing of the built archive, and the project's own proof-check.sh asserts what ends up in the artefact. It is in expected.json, and the full list of what ships is at the foot of this page.
What the tools reported
- trace-route-package@1.0.0: named by 6 of 6 tools at the source stage, 0 of 3 tools at the artefact stage.
Component by component
Ships: Y exact version, v wrong version, p wrong group or namespace, n not named. Does not ship: L listed and marked, X listed unmarked, · not listed. A tool appears under a stage only if it was run there, so an empty column never stands for a miss. Select a cell to see what is behind it.
Select a cell.
| source | artefact | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Component | capycli | cdxgen | cyclonedx-npm | sbom-tool | syft | trivy | cdxgen | syft | trivy |
| Ships. In the artefact, including components that were shaded or bundled on the way in. | |||||||||
| node-prepack-trace-lab@1.0.0 | |||||||||
| trace-route-package@1.0.0 prepack-generated | |||||||||
Every document
| Content accuracy | Baseline conformance | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Tool | Format | Comps | In scope | Shipped found | Wrong ver | Wrong purl | Leaked | Labelled | Hashes ok | NTIA 2021 | NTIA/CISA 2026 | BSI v2.1 |
| source | ||||||||||||
| capycli 2.12.0 | cyclonedx | 1 | 1 | 1/2 | 0 | 0 | 0 | 0 | 0/0 | 8.8 | 5.6 | 4.7 |
| cdxgen 11.3.2 | cyclonedx | 2 | 2 | 2/2 | 0 | 0 | 0 | 0 | 0/0 | 9.1 | 7.8 | 4.5 |
| cyclonedx-npm 6.0.1 | cyclonedx | 2 | 2 | 2/2 | 0 | 0 | 0 | 0 | 0/0 | 9.1 | 6.1 | 4.5 |
| sbom-tool 4.1.13 | spdx | 2 | 2 | 2/2 | 0 | 0 | 0 | 0 | 0/0 | 10.0 | 5.5 | 3.8 |
| syft 1.51.0 | cyclonedx | 2 | 2 | 2/2 | 0 | 0 | 0 | 0 | 0/0 | 5.4 | 4.6 | 3.4 |
| trivy 0.74.0 | cyclonedx | 3 | 2 | 1/2 | 0 | 0 | 0 | 0 | 0/0 | 4.9 | 4.3 | 3.5 |
| artefact | ||||||||||||
| cdxgen 11.3.2 | cyclonedx | 0 | 0 | 0/2 | 0 | 0 | 0 | 0 | 0/0 | 6.7 | 8.0 | 5.7 |
| syft 1.51.0 | cyclonedx | 0 | 0 | 0/2 | 0 | 0 | 0 | 0 | 0/0 | 3.1 | 4.4 | 4.1 |
| trivy 0.74.0 | cyclonedx | 1 | 1 | 0/2 | 0 | 0 | 0 | 0 | 0/0 | 3.1 | 4.4 | 4.1 |
- In scope: package components whose purl type is one of the test case's ecosystems (OS packages in images are ignored).
- Shipped found: recall against what is really in the artefact, at the exact version.
- Wrong ver: named, but at a version that does not ship. Wrong purl: right name and version under the wrong group, so no advisory database will match it.
- Leaked: things that do not ship (test, dev, build tooling,
provided, BOM imports) listed with nothing a consumer could filter on. - Labelled: the same things listed with a scope or property that marks them, which is correct.
+Ncounts further labelled components outside the known list. - Hashes ok: hashes that match the real digest of the jar inside the built artefact, over hashes the tool emitted for those jars.
- NTIA 2021, NTIA/CISA 2026, BSI v2.1:
sbomqs compliancetotals out of 10. They measure whether the fields are present, not whether the inventory is right.
Reading the result
A tool that reads the lockfile can name the package. None can tell that its contents were generated, because an SBOM identifies a package by name and version and says nothing about how its files came to be. Scanned on its own as an installed directory, the package has no lockfile beside it, which leaves a scanner little to go on.
This is our interpretation. The counts above are what the run recorded; why a tool found or missed something is inferred from how the tool works, not established by the data. Limits of the benchmark.
Evidence
- The project, and its walkthrough from the workshop it comes from.
- Ground truth (
expected.json). - Every SBOM generated for this test case at the source and artefact stages.
- The scores for every document, machine-readable.
Ground truth: what ships
| Component | Note |
|---|---|
pkg:npm/node-prepack-trace-lab@1.0.0 | primary component |
pkg:npm/trace-route-package@1.0.0 | the package is visible, but dist/index.js was written by scripts/generate-dist.js at pack time and is not in the package's source |