Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ permissions:
jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read

strategy:
matrix:
Expand Down Expand Up @@ -42,6 +44,8 @@ jobs:
build:
runs-on: ubuntu-latest
needs: test
permissions:
contents: read

steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
Expand Down
6 changes: 3 additions & 3 deletions src/privacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,10 @@ function sanitizeText(text) {
? text.slice(0, MAX_TEXT_LENGTH)
: text;

// Email addresses - use possessive-like matching to prevent backtracking
// Pattern: local part (alphanumeric, limited special chars) @ domain
// Email addresses - use simple linear pattern to prevent ReDoS
// Matches word characters/dots/hyphens before @, then domain
sanitized = sanitized.replace(
/[a-zA-Z0-9](?:[a-zA-Z0-9._-]{0,62}[a-zA-Z0-9])?@[a-zA-Z0-9](?:[a-zA-Z0-9.-]{0,252}[a-zA-Z0-9])?\.[a-zA-Z]{2,63}/g,
/[\w.-]+@[\w.-]+\.[a-zA-Z]{2,}/g,
'[email]'
);

Expand Down
Loading