Repository navigation
fix(compiler): emit the sanitizers ngtsc adds since 22.0.1 - #608
Open
GabeSilvaDev wants to merge 1 commit into
Open
GabeSilvaDev wants to merge 1 commit into
GabeSilvaDev wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Port the sanitization fixes Angular shipped from 22.0.1 on, each gated on the releases that got it upstream: - sanitize two-way property bindings (angular/angular@3c70270c96) - check host bindings against every concrete host element, so a selector without a URL sink no longer drops the sanitizer (angular/angular@d06e3748b7) - treat href / xlink:href of any MathML element as a URL (angular/angular@3927a5b271) - fall back from the :svg: / :math: keys to the HTML keys and validate iframe credentialless (angular/angular@32d7315094, angular/angular@0152e3cbdf) - look an <animate> outside <svg> up in the SVG keys (angular/angular@7168bed663)
GabeSilvaDev
force-pushed
the
fix/sanitizer-parity
branch
from
October 22, 2026 04:17
bdb3f5f to
717f0c7
Compare
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
Several bindings that ngtsc sanitizes compile without a sanitizer in OXC. Two of the gaps are direct XSS sinks in the compiled app:
OXC on
main:ngc 22.2.2, and OXC with this change:
Most of these are upstream fixes from 22.0.1 on that the port had not picked up yet. Each one is gated on the releases that shipped it, like the existing schema versions:
resolve_sanitizershandlesTwoWayPropertyops.host_binding_security_context_forportscalcHostBindingSecurityContexts: the binding is checked against every known element, and NONE next to a URL kind givesɵɵsanitizeUrlOrResourceUrl.href/xlink:hrefof any MathML element (angular/angular@3927a5b271)V22_0_1schema kind with a:math:*key; lookups try the namespace's*key.checkSecurityContext(angular/angular@32d7315094) and iframecredentialless(angular/angular@0152e3cbdf)V22_0_2schema kind:<svg><iframe [src]>falls back to `iframe<svg>(angular/angular@7168bed663)Static attributes (
ɵɵtrustConstantHtml/ɵɵtrustConstantResourceUrl) andresolveI18nAttrSanitizerswere ported in #598, so this PR no longer touches them.html_to_r3anddom_security_schematests that asserted the old latest-version behavior now pin the version they describe. The selector-parsing tests check the declaring-selector half of the host lookup directly. The linker test whose comment said concrete host contexts were not ported now asserts both sides.Tests
tests/sanitizer_parity_test.rschecks each fix against ngc 22.2.2 output, on the first fixed release of each line and on the release just before it.security_backports_follow_each_release_linecovers the version cutoffs, prereleases included.regressions/sanitizer-parity.fixture.tsadds 12 e2e compare fixtures. All 12 fail onmainand match ngc 22.2.2 with this change (known-differenceonly for theɵsetClassDebugInfofilePath, like every other fixture). Across all 1227 fixtures nothing else changes status.cargo fmt --all -- --check,cargo test --all-features(3485 passed) andcargo run -p oxc_angular_conformance(1264/1264, no snapshot diff) all pass.