Repository navigation
chore: add the OSS Scanner build and threat model - #22
Merged
Merged
Conversation
chmod does not stop root from writing, so under root the store stays writable and the health check reports pass. The startup checks for an unwritable database already skip as root or on Windows; this test now skips under the same condition. It failed in containers that run the suite as root, such as the OSS Scanner image.
Anthropic's OSS Scanner builds an enrolled project from a Dockerfile and then audits it without network access. .oss-scanner/Dockerfile installs the dependencies and the Foundry version CI uses, builds the package and runs npm test. .oss-scanner/threat_model.md summarizes SECURITY.md for the scanner: where untrusted input enters, which components matter, how to rate severity, and which documented behavior is not a finding.
Revinand
approved these changes
Oct 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
.oss-scanner/, the two files Anthropic's OSS Scanner reads from an enrolled repository:.oss-scanner/Dockerfileinstalls the Node 22 dependencies and the Foundry version CI pins (v1.7.1, checksum-verified), builds the package and runsnpm test..oss-scanner/Dockerfile.dockerignorereplaces the root.dockerignorefor this build only (BuildKit's per-Dockerfile ignore file). The root file is written for the demo images and leaves outcontracts/lib, the vendored forge-std the contract tests compile against. The demo images are unchanged..oss-scanner/threat_model.mdsummarizesSECURITY.mdfor the scanner: where untrusted input enters, which components matter, how we rate severity, and which documented behavior is not a finding.Why
The scanner builds an enrolled project with network access, then audits it offline with Claude and emails findings, each with a reproducer and a proposed patch, to the security contact. Keeping both files in this repository, the option the scanner recommends, lets us change the build or the threat model without a pull request to
anthropics/oss-scanner. The enrolment itself is a separate PR there that addsprojects/agent-commerce/project.yamlpointing at these paths, opened after this one merges.Review focus
threat_model.md, "How we rate severity". The scanner uses them to rank its reports, so they should match how we would triage.SECURITY.md→ "What the gateway does not protect against". Anything listed there will not be reported.How it was tested
tools/checkfromanthropics/oss-scanner, run against this branch, clones the repo, builds.oss-scanner/Dockerfileand adds the scanner's layer. It finished with "agent-commerce builds.", and the tests during the build gave 115/115 files, 2359 passed and 6 skipped.--network none,npm testgives the same result: 2359 passed, 6 skipped. The scanner can therefore run the suite offline. Anvil, forge-std and the solc download are all in the image.npm run lint,tsc --noEmitand the changed test file pass.Also in this PR
test(storage): skip the unwritable-store check when running as root. The "unwritable store" test relies onchmod 0444, which does not stop root from writing, so it failed in the scanner image, which runs as root. The startup checks for an unwritable database in the same file already skip as root or on Windows. This test now skips under the same condition and still runs as a normal user.What it does not cover
anthropics/oss-scannerPR, which also sets the publicprimary_contactaddress..oss-scanner/is not part of the npm package (fileslists onlydist,README.mdandLICENSE), and nothing in CI or the demo stack uses it.