Repository navigation
Redact IPv4 addresses that end a sentence - #4
Merged
Merged
Conversation
The IP rule rejected any match followed by ".", so "from 10.20.3.14." kept the address. Only ".<digit>" now blocks a match, which still leaves longer dotted numbers such as "1.2.3.4.5" alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Follow-up to #2: this commit was pushed to that branch just as it merged, so it didn't make it into
main.Bug
The built-in IP rule's lookahead rejected any match followed by
., so an address at the end of a sentence was stored unredacted:from 10.20.3.14.→ unchanged (leaked)from 10.20.3.14, ok→from [REDACTED:ip], okFix
Only
.<digit>now blocks a match, so sentence-ending IPs are redacted while longer dotted numbers such as1.2.3.4.5are still left alone.Tests
The regression test in
tests/core/test_core.pycovers a sentence-ending IPv4 and IPv6 and checks that a dotted version number is untouched.pytest(85),ruff checkandruff format --checkpass locally.🤖 Generated with Claude Code