Skip to content

JavaScript: preserve sanitizer barriers on guarded phi inputs - #23005

Open
nikhilred2619 wants to merge 1 commit into
github:mainfrom
nikhilred2619:fix/js-sanitizer-guard-phi-inputs-22848
Open

nikhilred2619 wants to merge 1 commit into
github:mainfrom
nikhilred2619:fix/js-sanitizer-guard-phi-inputs-22848

Conversation

@nikhilred2619

Copy link
Copy Markdown

Fixes #22848.

This change fixes false positives caused by sanitizer guards being lost across SSA phi inputs.

The fix preserves branch-specific barriers while keeping direct flow edges for inputs without a dominating condition.

I also added regression tests covering safe fallbacks, guarded loops, incorrect guard conditions, reflected XSS, and resource exhaustion. The existing spurious alert in UnsafeShellCommandConstruction is removed.

Testing: All 21 affected tests passed locally.

Related PR: #22873 addresses the same underlying issue. This version additionally limits synthetic phi-input nodes to guarded predecessor blocks and includes broader regression coverage.

Happy to make any adjustments based on feedback.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JS: Some sanitizer guards no longer apply after if (!check(x)) x = default (false positives since 2.20.2)

1 participant