Title: feat(core): change the URL sanitization to only block javascript: URLs by neuracr · Pull Request #49659 · angular/angular · GitHub
Open Graph Title: feat(core): change the URL sanitization to only block javascript: URLs by neuracr · Pull Request #49659 · angular/angular
X Title: feat(core): change the URL sanitization to only block javascript: URLs by neuracr · Pull Request #49659 · angular/angular
Description: In modern browsers, the 'javascript:' URL scheme is the only scheme that can execute JavaScript when passed in a navigation URL context (e.g. a.href value). Validate URL shemes to only contain characters allowed in the URL specification ([a-zA-Z-+.]), and that are not javascript (case insensitive). This is not a breaking change. The URL sanitization is loosen. PR Checklist Please check if your PR fulfills the following requirements: The commit message follows our guidelines: https://github.com/angular/angular/blob/main/CONTRIBUTING.md#commit Tests for the changes have been added (for bug fixes / features) Docs have been added / updated (for bug fixes / features). The documentation is already explaining the javascript: URLs are sanitized. This is still the case, and is the only scheme being sanitized. PR Type What kind of change does this PR introduce? Bugfix Feature Code style update (formatting, local variables) Refactoring (no functional changes, no api changes) Build related changes CI related changes Documentation content changes angular.io application / infrastructure changes Other... Please describe: Security change. What is the current behavior? The navigation URL sanitization in Angular is currently allowlist based. It allows implicit shemes, or explicit scheme oneof https?|mailto|data|ftp|tel|file|sms that are known to be always safe wrt. XSS. Issue Number: N/A What is the new behavior? The new sanitization algorithm validates the scheme has characters allowed by the URL specification. It is also blocklist based and blocks the javascript scheme (non case sensitive). Does this PR introduce a breaking change? Yes No Other information
Open Graph Description: In modern browsers, the 'javascript:' URL scheme is the only scheme that can execute JavaScript when passed in a navigation URL context (e.g. a.href value). Validate URL shemes to only cont...
X Description: In modern browsers, the 'javascript:' URL scheme is the only scheme that can execute JavaScript when passed in a navigation URL context (e.g. a.href value). Validate URL shemes to o...
Opengraph URL: https://github.com/angular/angular/pull/49659
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:3b1f1905-109b-a88f-3748-9b6cc3716bb7 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | DB48:EDA7A:CA3F63:101E500:6B010044 |
| html-safe-nonce | a0965b0e719591cd41f71558cc0a44b64988cdbd43d4b6d84ed2f36912fd44bf |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQjQ4OkVEQTdBOkNBM0Y2MzoxMDFFNTAwOjZCMDEwMDQ0IiwidmlzaXRvcl9pZCI6IjY2MjY0NzgzMTE0NzAwNzE4NzYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 5efb9908ba24f76c8b7a3e5b4d055e1b5cf7444cd637455193c5ecc3239579f5 |
| hovercard-subject-tag | pull_request:1297637766 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/angular/angular/pull/49659/files |
| twitter:image | https://avatars.githubusercontent.com/u/26376659?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/26376659?s=400&v=4 |
| og:image:alt | In modern browsers, the 'javascript:' URL scheme is the only scheme that can execute JavaScript when passed in a navigation URL context (e.g. a.href value). Validate URL shemes to only cont... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width