Repository navigation
security: keep tar 7 out of the Docker image and record the new tar advisories - #466
Closed
italomacedo wants to merge 2 commits into
Closed
italomacedo wants to merge 2 commits into
italomacedo wants to merge 2 commits into
Conversation
…dvisories sqlite3, node-gyp and @mapbox/node-pre-gyp still depend on tar 7, which has no patched release. They use it only while installing, so the Dockerfile removes those copies after npm ci and fails the build if any tar older than 8 is left in node_modules. The tar 7 advisories published on 2026-12-02 are added to audit-allowlist.json so that npm audit in CI fails only on something new. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
fhir-test-cases added htmlTest05-07 (FHIR/fhir-test-cases#350, merged 2026-12-02), which call .text.div.htmlChecks() on a Bundle. div is a keyword in this parser, as for the existing text.div.htmlChecks() case. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
|
closing this as the approach from Josh was a little more thorough |
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.
Problem
The tar 7 advisories published on 2026-12-02 (CVE-2026-140240, CVE-2026-140244 and others) make
node utilities/audit-check.js --audit-level=highfail. FHIRsmith's owntaris already 8; the vulnerable copies come fromsqlite36.0.1,node-gypand@mapbox/node-pre-gyp2.0.3 (underroaring). There is no patched tar 7, and none of those packages has a release on tar 8 yet.What this does
npm ci, since they are only used while installing. The build fails if anytarolder than 8 is left innode_modules.<8advisories, with the same expiry as the existing entry (2027-03-01).This is a mitigation, not a full fix: installs from npm or from a clone still get tar 7 under those packages. The allowlist entries are your call; drop or shorten them as you see fit.
Why not an npm override to tar 8
I tried
"overrides": { "tar": "$tar" }.@mapbox/node-pre-gypcallstar.extract()as a stream, which tar 8 no longer accepts, so installingroaringfails (TypeError: extract needs input or file).node-gypuses the same call when it downloads headers. Overriding onlysqlite3also movednode-gypto tar 8, so I left the dependency tree alone.Verification
docker buildsucceeds.sqlite3,roaringandbcryptload, the onlytarin/app/node_modulesis 8.0.5, and the server starts with a minimal configuration.npm audit, filtered by the new allowlist, has nothing left at high or above, and nothing at moderate or above with--omit=dev.Unrelated test fix, needed for green checks
Test (2/2)was failing on four FHIRPath tests, with or without this change. FHIR/fhir-test-cases#350 (merged 2026-12-02) addedhtmlTest05-07, which call.text.div.htmlChecks()on a Bundle, andparser.jstreatsdivas a keyword. The second commit adds the three expressions to the "parser is stricter than Java" lists, next to the existingtext.div.htmlChecks(). Whether the parser should accept.divinstead is your call. With the latest test cases, both FHIRPath suites pass locally (1468 tests).Not covered
The
node:24-alpinebase image ships npm with its own bundledtar(7.5.22 in the image I built), outside/app. Removing npm from the runtime stage would address that, but it changes what is available in the container, so I did not do it here.🤖 Generated with Claude Code