Skip to content

fix: fix deep sensitive redaction#43

Merged
ccharly merged 6 commits into
mainfrom
cc/fix/fix-deep-sensitive
Jul 16, 2026
Merged

fix: fix deep sensitive redaction#43
ccharly merged 6 commits into
mainfrom
cc/fix/fix-deep-sensitive

Conversation

@ccharly

@ccharly ccharly commented Jul 15, 2026

Copy link
Copy Markdown

Ancestor branches were still able to keep a reference to the original data that was not redacted, resulting in potentially leaking the sensitive data using custom failure reporting.


Note

Medium Risk
Changes sensitive-data redaction in error branches; incorrect ancestor patching could still leak secrets or alter failure shapes for custom reporters.

Overview
Fixes a leak where sibling-field validation failures could still expose sensitive values on outer entries in failure.branch, because ancestors kept live references to the unredacted child object.

withRedactedBranch now redacts the matched parent, then walks ancestors backward, copying each level and swapping the child reference for the already-sanitized branch entry. Plain objects, arrays, and Maps are handled separately.

Adds validation fixtures for nested objects, deep nesting, array-wrapped secrets, and Map-wrapped secrets.

Reviewed by Cursor Bugbot for commit 4e88633. Bugbot is set up for automated code reviews on this repo. Configure here.

@ccharly
ccharly requested a review from a team as a code owner July 15, 2026 20:07
@ccharly
ccharly force-pushed the cc/fix/fix-deep-sensitive branch from d780b98 to 8d3c281 Compare July 15, 2026 20:08
@ccharly
ccharly force-pushed the cc/fix/fix-deep-sensitive branch from 8d3c281 to 94370f0 Compare July 15, 2026 20:08
Comment thread src/structs/sensitive.ts
Comment thread src/structs/sensitive.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c86b4f4. Configure here.

Comment thread src/structs/sensitive.ts
hmalik88
hmalik88 previously approved these changes Jul 16, 2026
@ccharly
ccharly enabled auto-merge (squash) July 16, 2026 14:58
@ccharly
ccharly merged commit b7b6baf into main Jul 16, 2026
22 checks passed
@ccharly
ccharly deleted the cc/fix/fix-deep-sensitive branch July 16, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants