Repository navigation
fix(privacy): bound the private-key scan, redact non-ASCII passwords, detect sk-ant keys - #1775
Merged
Merged
Conversation
… detect sk-ant keys (#1772, #1773, #1774) The private-key scan reads a total proportional to the text and masks the rest past that cap. A single-token value assigned to a password name is judged on its content even when it holds a non-ASCII character. sk-ant-<kind><nn>- keys have their own rule, since the generic sk- rule needs one 20+ character part. Closes #1772, closes #1773, closes #1774
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
| fn the_private_key_scan_does_work_in_proportion_to_the_text() { | ||
| // Markers whose body is never key material: every BEGIN used to read a | ||
| // 16 KiB window, so the work grew with the square of the text. | ||
| let text = "-----BEGIN PRIVATE KEY-----\nshort\n".repeat(60_000); |
This was referenced Nov 14, 2026
Merged
8 of 10 tasks
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
Three fixes in the
uteke-privacysecret detector, plus a### Securityline in the[0.24.0]CHANGELOG:sk-ant-<kind><nn>-keys get their own rule, since the genericsk-rule needs one 20+ character part between-and_.Why
Found in the v0.24.0 release review. All three predate v0.23.0 (the detector was moved unchanged from
uteke-corein #1737), so they are not regressions of this release, but the release should not ship them: the first lets one large write request stall the server, the other two let real secrets throughredactand strict mode.Testing
sk-ant-key with only short parts is detected, and a hyphenatedsk-ant-colony-...name is not.sk-ant-tests fail; on this branch all 23 unit tests and 2 doc tests ofuteke-privacypass, and the 38uteke-coretests that exercise redaction pass.cargo clippy -p uteke-privacy --all-targets -- -D warningsandcargo fmt --checkare clean.Closes #1772, closes #1773, closes #1774