Repository navigation
fix(privacy): skip a run of bare [REDACTED markers in a loop over the whole text - #1816
Merged
Merged
Conversation
… whole text (#1794) The skip of a bare `[REDACTED` in front of a value ran inside the 4096-byte window of one value and recursed once per marker. A run of 456 or more markers filled the window, so the secret behind it was never read, and the recursion depth followed untrusted input. The skip is now a loop in assignment_value, over the whole text, before the window is taken. Test: 1, 455, 456, 457 and 200 000 markers in front of a secret, all masked. Mutation gate on the diff: 19 mutants, 19 caught.
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
4 tasks done
This was referenced Nov 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
assignment_valueinuteke-privacyskips the bare[REDACTEDmarkers in front of a value in a loop over the whole text, before the 4096-byte window of one value is taken. The recursive skip insideassignment_value_inis removed.Why
Found by the Cora review of the v0.24.2 release PR (#1815), which is the first review that diffs the whole release against
main. It flagged the recursion in the #1794 change. Checking it:The loop fixes both: no recursion, and the markers no longer count against the window.
Testing
a_long_run_of_bare_redacted_markers_does_not_hide_the_secret: 1, 455, 456, 457 and 200 000 markers in front of a secret; the output is the markers plus[REDACTED:env-secret]and the token is gone. It failed before the change (token in clear for 200 000) and passes after.cargo test -p uteke-privacypasses (29 + 2)cargo clippy -p uteke-privacy --all-targets -- -D warningsandcargo fmt --all -- --checkpasscargo mutants -p uteke-privacy --in-diff): 19 mutants, 19 caughtRelated Issues
Refs #1794. Blocks the v0.24.2 release PR #1815 (it needs to be refreshed from
developafter this merges).