Skip to content

Fix email redaction before trailing periods#4

Draft
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/critical-bug-investigation-c94b
Draft

Fix email redaction before trailing periods#4
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/critical-bug-investigation-c94b

Conversation

@cursor

@cursor cursor Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix scp_mask_secrets so emails followed by a sentence-ending period are redacted instead of leaked.
  • Add a regression test for alice@example.com. punctuation handling.
  • Sync the vendored MCP contract hash expectation so the test suite reflects the current contract file.

Bug and Impact

The recent linear email masker treated a trailing . as part of the domain, then rejected the whole span because it ended in an empty label. Common prose like Contact alice@example.com. was returned unredacted, leaking PII through the LLM06 masking path.

Root Cause

The domain scanner consumed every . while scanning, including punctuation after the TLD. Validation later rejected example.com. as an invalid domain instead of masking example.com and leaving the period outside the email span.

Fix

Stop scanning the domain when a . is not followed by a valid domain-label character, preserving the punctuation while redacting the email span.

Validation

  • PYTHONPATH=src python3 -m pytest tests/test_security_regressions.py::test_mask_email_before_sentence_period
  • PYTHONPATH=src python3 -m pytest
  • Focused correctness/security review agents reported no findings.
Open in Web View Automation 

cursoragent and others added 3 commits June 14, 2026 11:03
Co-authored-by: Andre Schu <Art.Int.Interface@gmail.com>
Co-authored-by: Andre Schu <Art.Int.Interface@gmail.com>
Co-authored-by: Andre Schu <Art.Int.Interface@gmail.com>
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.

1 participant