feat(detect): Detect SSNs hidden under white rectangles#217
Open
mlissner wants to merge 5 commits into
Open
Conversation
PII-containing redactions (SSNs for now) bypass the pixmap filter. White rectangles hiding SSNs render as non-unicolor due to form grid lines, but the text is fully hidden and extractable. Also changes the occlusion threshold from > to >= so characters that are exactly 80% occluded are counted (the covering rectangles in this PDF are slightly shorter than the character bboxes). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Real-world bankruptcy form where an SSN is covered by white form cell backgrounds. The text is invisible but extractable. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
mlissner
commented
Apr 18, 2026
Keeps the PII/pixmap split logic in its own function per review feedback. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
mlissner
commented
Apr 18, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 tasks
SSN detection bypasses the pixmap filter and is distinct from normal TEXT_UNDER_RECTANGLE. Give it its own type so consumers know a PII pattern was matched. Co-Authored-By: Claude Opus 4.6 (1M context) <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.
Summary
Detect Social Security Numbers hidden under white rectangles, as seen in this bankruptcy form where form cell backgrounds cover the SSN text.
Two changes:
PII bypass of pixmap filter — redactions containing PII patterns (SSNs) skip the pixmap check entirely. White rectangles hiding SSNs render as non-unicolor due to form grid lines, causing the pixmap filter to incorrectly drop them. Since the text passed intersection checks (a rectangle was drawn on top of it), and it matches a PII pattern, it should always be flagged.
Occlusion threshold
>→>=— the white covering rectangles in this PDF are 8pt tall while character bboxes are 10pt, giving exactly 80.0% occlusion. The strict>check rejected them.Test plan
test_ssn_under_white_rectanglewith real-world bankruptcy form(Specify)not flagged)🤖 Generated with Claude Code