security: override tmp to fix insecure temporary file creation (GHSA-ph9p-34f9-6g65)#104
security: override tmp to fix insecure temporary file creation (GHSA-ph9p-34f9-6g65)#104barretts wants to merge 1 commit into
Conversation
…ph9p-34f9-6g65) tmp prior to 0.2.6 creates temporary files with predictable names and insecure default permissions (GHSA-ph9p-34f9-6g65, HIGH). The package is a transitive dependency via external-editor (used by inquirer, a devDependency). external-editor@3.1.0 (latest) pins tmp@^0.0.33 which cannot resolve to 0.2.x; a yarn resolution forces the tree to ^0.2.6. Production risk: NONE (build-time only -- tmp is pulled via np/inquirer devDependency chain). Skill-Sig: ad61853a
|
Grackle review -- no-CI tmp override ^0.2.6 (GHSA-ph9p-34f9-6g65) VerificationFindingsLOW #1 -- tmp 0.2.x has breaking callback semantics vs 0.0.x VERIFIED: tmp 0.2.0 changed async/sync callback behavior (PR #220, #231). However, the only consumer in this tree (external-editor@3.1.0) uses tmpNameSync which is API-stable across both major lines. No runtime impact. Confirmed via upstream source (raszi/node-tmp CHANGELOG.md and mrkmg/node-external-editor src/index.ts:12,149). Verified location: LOW #2 -- Resolution range uses ^ not exact pin VERIFIED: package.json:90 uses "^0.2.6" which allows 0.2.7+ but not 0.3.x. This is intentional -- it tracks patch releases within the fixed line. Current resolution is 0.2.7 (yarn.lock:6100). Acceptable for a devDependency override. Verified location: What's solid
Priority stack for the authorNo action required. The fix is minimal, correctly scoped, and safe to merge as-is. Recommendation: GO skill-sig: 26cfcbaf · 3pp-skill-sig: ad61853a |
84db7c2c)Summary
Fixes 1 high severity 3PP vulnerability in
tmp(GHSA-ph9p-34f9-6g65).tmpprior to 0.2.6 creates temporary files with predictable names and insecure default permissions, allowing local attackers to read or modify sensitive temporary data.Production risk: Build-time only:
tmponly appears underexternal-editor->inquirer->np, which is a devDependency. It is not loaded by the production runtime.Strategy: override (yarn resolution)
Why
tmp@0.0.33has an insecure temporary file creation vulnerability (GHSA-ph9p-34f9-6g65, HIGH), first patched in 0.2.6. The package is pulled in transitively byexternal-editor@3.1.0(the latest release), which declarestmp@^0.0.33-- a range that will never resolve to 0.2.x. Sinceexternal-editorhas no newer release that updates this range, a yarn resolution is the only available fix without replacing the entireinquirer->external-editorchain.Changes
package.json
Added a yarn
resolutionsentry to forcetmpto^0.2.6:Why resolution override?
external-editor@3.1.0(latest) declarestmp@^0.0.33, a range that cannot resolve to 0.2.x. There is no newer release ofexternal-editorthat bumps this range. The resolution forces yarn to resolvetmpto 0.2.7 (latest in the 0.2.x line) across the entire tree.yarn.lock
Lockfile re-resolved:
tmpmoved from 0.0.33 to 0.2.7. Theos-tmpdirtransitive dependency (only needed by tmp@0.0.x) is removed from the tree.Resolutions and overrides
tmp^0.2.6external-editor@3.1.0(used byinquirer, a dep ofnp).external-editordeclarestmp@^0.0.33which cannot resolve to 0.2.x; no newer release exists. Resolution forces safe version.external-editorreleases a version whose range declarestmp@>=0.2.6. Track upstream: https://github.com/mrkmg/node-external-editor/releases. Verify with3pp-util trace-vuln tmp. Reviewer-local:yarn why tmp.Risk Classification
This vulnerability exists only in build-tool dependencies. Production risk: NONE. Remediation prevents scanner noise and supply-chain exposure during CI.
Vulnerabilities Fixed
How to test
Validation
Validation is a before/after comparison. The baseline captured pre-existing install failures due to the corepack ancestor-walk issue (unrelated to this fix).
All four phases recovered after the fix was applied. No regressions introduced.
Notes
np(devDep) ->inquirer->external-editor->tmp@^0.0.33tmp@0.2.xdrops theos-tmpdirdependency entirely (uses Node built-inos.tmpdir())external-editoris at its latest release (3.1.0, published 2019) and is unlikely to receive updatesskill-sig:
26cfcbaf· grackle-sig:84db7c2c· 3pp-skill-sig:ad61853a· 3pp-skill canonical pipeline · 3pp-grackle babysit