Skip to content

JavaScript: Reduce FPs in incomplete-sanitization for bracket pair removal#17

Open
mrigankpawagi wants to merge 1 commit into
mainfrom
improve-js-incomplete-sanitization-brackets
Open

JavaScript: Reduce FPs in incomplete-sanitization for bracket pair removal#17
mrigankpawagi wants to merge 1 commit into
mainfrom
improve-js-incomplete-sanitization-brackets

Conversation

@mrigankpawagi

Copy link
Copy Markdown
Owner

Fix

Extends the bracket/brace pair removal exclusion in the js/incomplete-sanitization query to cover more display-formatting patterns where bracket removal is intentional.

Problem

The query flags .replace("[", "") and .replace("]", "") pairs used for display formatting (stripping brackets from array representations) as incomplete sanitization. These are not security-relevant sanitizers - they are display formatters.

Validation

Static analysis confirms the pattern matches the existing isDelimiterUnwrapper logic but covers additional cases where the removal pattern is slightly different.

The isDelimiterUnwrapper predicate now also handles cases where bracket
pairs are removed using regex patterns (e.g., s.replace(/{/, '').replace(/}/, '')),
not just string literals. This reduces false positives for display-oriented
bracket stripping.
@github-actions github-actions Bot added the JS label Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants