fix:bundle import can overwrite the audit log#167
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR hardens bundle import security by adding manifest-level and path-level validation. It defines forbidden artifacts ( ChangesBundle import safety enforcement
Possibly related PRs
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@plind-junior Could you plz review my PR? |
ReviewSummary: Adds What works
Suggestions
Verdictapprove — The fix correctly closes the reported vulnerability. Both |
|
PR didn't target test branch will be auto closed by an agent |
|
Replacement PR targeting |
|
@plind-junior Could you plz reopen my PR #167 and draft? Thanks! |
Summary
This PR fixes issue #166 by making bundle import reject non-committable or unsafe files before they can be written into
.vouch/.Previously, a crafted bundle containing
audit.log.jsonlcould passvouch import-checkand overwrite the append-only audit log when imported with--on-conflict overwrite.The fix enforces the documented bundle safety contract:
audit.log.jsonlstate.dbstate.db-*proposed/*has_audit_log: trueRelated Issue
Fixes: #166
Change Type
Real Behavior Proof
Before the fix, this malicious bundle was accepted:
And overwrite import replaced the audit log:
After the fix, the same bundle is rejected:
And import refuses to write:
The original audit log remains intact.
Checklist
import-checkpreviously accepted the malicious bundleimport-apply --on-conflict overwritepreviously overwroteaudit.log.jsonlSummary by CodeRabbit
Security
Tests