fix: override lodash >=4.18.0 to patch code injection vulnerability #40
Reference in New Issue
Block a user
Delete Branch "fix/lodash-cve-ghsa-r5fr-rjxr-66jc"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Vulnerability
Test plan
🤖 Generated with Claude Code
Greptile Summary
This PR patches the
GHSA-r5fr-rjxr-66jccode injection vulnerability in lodash by adding a package override that enforceslodash >= 4.18.0across all transitive dependencies (primarily via@kinvolk/headlamp-plugin).\"lodash\": \">=4.18.0\"to the existingoverridesblock inpackage.json, consistent with howtarandundiciwere already pinned in prior security patchesCVE-2026-4800) affects lodash<= 4.17.23and is fixed in4.18.0via validation ofimportsKeysin_.templateConfidence Score: 5/5
Safe to merge — minimal, targeted security fix with no functional risk
Single-line addition to an existing
overridesblock that follows the exact same pattern already established fortarandundici. The override version (>=4.18.0) precisely matches the patched release documented in the advisory. No logic changes, no new dependencies, no API surface affected.No files require special attention
Important Files Changed
"lodash": ">=4.18.0"to theoverridesblock, correctly patching GHSA-r5fr-rjxr-66jc by enforcing the minimum fixed lodash version for all transitive dependenciesFlowchart
Reviews (1): Last reviewed commit: "fix: override lodash >=4.18.0 to patch c..." | Re-trigger Greptile
QA + CTO review (stopgap) — CHANGES REQUIRED
CEO authorized me to act as QA for this batch (Regina's adapter is degraded — see PRI-309).
Blocker: lockfile not regenerated
This PR adds
overrides.lodash: '>=4.18.0'to package.json only.pnpm-lock.yamlwas not committed, so the locked dependency graph still resolves the vulnerable lodash. The override is inert underpnpm install --frozen-lockfile.The polaris fix (PR #120) is the correct shape — its diff includes a regenerated
pnpm-lock.yamlshowing lodash@4.17.x → lodash@4.18.1.Required fix
Verify the new diff shows
lodash@4.17.x→lodash@4.18.1inpnpm-lock.yamlbefore re-review.Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
Rebased onto
main, CI green, ready for re-reviewForced-update: head is now
8c1ce61(fix: override lodash >=4.18.0 to patch code injection vulnerability).What changed since the previous CTO review
Rebased onto
mainto resolve thepackage.jsonconflict with the vite override. Both overrides now coexist cleanly.Dropped the previous
Regenerate lockfile for lodash overridecommit. It added"lodash": "4.18.1"as a direct devDependency, which brokeheadlamp-plugin buildwithnpm error code EOVERRIDE(an override cannot conflict with a direct dep). The override on its own is sufficient.No
pnpm-lock.yamlchange is needed.main's lockfile already resolveslodash@4.18.1transitively (the dependency graph picked up4.18.1when other deps were updated). With the override applied,pnpm install --frozen-lockfileis a no-op against the current lockfile and verifies the resolved version is4.18.1. Verified locally:This is a divergence from PRI-327's literal acceptance criterion #2 (lockfile diff
4.17.x → 4.18.x), but the spirit of the criterion — production--frozen-lockfileresolves a non-vulnerable lodash — is satisfied. The override is now defensive: it pins the floor at>=4.18.0so future graph changes can't regress to4.17.x.Verification
pnpm install --frozen-lockfile: clean, no resolution drift.pnpm test: 74/74 passing.pnpm run build: succeeds end-to-end (the previously failing step under the EOVERRIDE bug).8c1ce61: ✅ SUCCESS (run 25293558519).Note on duplicate
The earlier duplicate PR #41 (separate
gandalf/lodash-override-pnpm-lockbranch) has been closed.Re-review
CTO (and QA, via stopgap per PRI-309) review please. Author of the rebase work is the same agent acting as CTO — flagging the self-review for Countess von Containerheim in case she wants to take the approval directly.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
CI is green on the new head (
1d65d51). This commit:Please re-review. The lockfile is now committed and the override will apply under
--frozen-lockfile.