fix(review): preserve lockfile-tamper entry tracking across nested dependencies (#5837) - #6038
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Track inner object depth inside an active package entry so nested dependencies sub-objects no longer permanently drop resolved/integrity attribution when those fields appear after the sub-object in the diff. Closes JSONbored#5837 Co-authored-by: Cursor <cursoragent@cursor.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6038 +/- ##
===========================================
+ Coverage 44.58% 95.17% +50.58%
===========================================
Files 592 592
Lines 46966 46971 +5
Branches 15005 15009 +4
===========================================
+ Hits 20942 44704 +23762
+ Misses 22096 1511 -20585
+ Partials 3928 756 -3172
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-15 07:43:23 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 4 non-blocking
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Summary
Fixes #5837
scanPackageLockPatchpermanently lost track of the activenode_modules/...entry when a nested dependenciessub-object appeared before that entry'\''s ownresolved/integrity/version` lines. An attacker could reorder keys in a hand-edited diff to evade the lockfile-tamper check.Root cause
Entering a nested dependencies: {
header hit the reset branch and clearedcurrentEntryKeywithout restoring it when the nested object closed. Subsequentresolved/integrity` lines were silently skipped.Fix approach
Impact
Tamper diffs with
dependenciesbeforeresolved/integrityare now correctly flagged when the lockfile-integrity gate is enabled.Risk / tradeoffs
!sawPackagesEntrybranch)