Title: Angular service worker bypasses explicit `redirect: 'error'`, leaks authenticated content into JavaScript, and replays it after logout. · Issue #68620 · angular/angular · GitHub
Open Graph Title: Angular service worker bypasses explicit `redirect: 'error'`, leaks authenticated content into JavaScript, and replays it after logout. · Issue #68620 · angular/angular
X Title: Angular service worker bypasses explicit `redirect: 'error'`, leaks authenticated content into JavaScript, and replays it after logout. · Issue #68620 · angular/angular
Description: Which @angular/* package(s) are the source of the bug? service-worker Description Details Angular service worker asset handling reconstructs outgoing requests through AssetGroup.newRequestWithMetadata() while preserving headers only. In ...
Open Graph Description: Which @angular/* package(s) are the source of the bug? service-worker Description Details Angular service worker asset handling reconstructs outgoing requests through AssetGroup.newRequestWithMetad...
X Description: Which @angular/* package(s) are the source of the bug? service-worker Description Details Angular service worker asset handling reconstructs outgoing requests through AssetGroup.newRequestWithMetad...
Opengraph URL: https://github.com/angular/angular/issues/68620
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Angular service worker bypasses explicit `redirect: 'error'`, leaks authenticated content into JavaScript, and replays it after logout.","articleBody":"### Which @angular/* package(s) are the source of the bug?\n\nservice-worker\n\n### Description\n\nDetails\nAngular service worker asset handling reconstructs outgoing requests through AssetGroup.newRequestWithMetadata() while preserving headers only. In the redirected asset path, this drops explicit redirect policy from the original request. As a result, a caller-supplied fetch(..., {redirect: 'error'}) is turned into a redirect-following request inside the framework service worker.\n\nThe root cause is in Angular-owned code:\n\npackages/service-worker/worker/src/assets.ts\nAssetGroup.fetchFromNetwork() manually follows redirected responses\nAssetGroup.newRequestWithMetadata() rebuilds requests without preserving explicit redirect\nThis is a framework-owned request-policy bypass, not generic stale-cache behavior, because the browser's original decision is to reject the request and Angular service worker changes that outcome.\n\nAttack scenario\nAny actor who can get a victim to open a normal page or deep link that causes the Angular application itself to fetch the public asset URL can exploit this behavior in an Angular application that uses the Angular service worker on the affected scope and has a same-origin redirect from a public asset path to authenticated/private content. The attack does not need injected JavaScript in the victim origin if the app already performs the asset fetch on page load or route change.\n\nWhat they gain:\n\naccess to authenticated same-origin secret content that the browser would not have returned for the original redirect: 'error' request\npersistence of that secret under a public URL in the Angular service-worker cache\nreplay of the secret after logout, because the cached public URL continues returning the previously fetched private content\nThe strongest proven impact is confidentiality exposure to JavaScript plus post-logout replay of authenticated content. The current browser repro already models a realistic app-origin trigger because opening /?auto=1 causes the page's own boot script to issue the vulnerable fetch automatically, and the fetched path is an asset-style JSON URL matching the kind of startup/route asset requests Angular-owned code already performs.\n\n### Please provide a link to a minimal reproduction of the bug\n\n_No response_\n\n### Please provide the exception or error you saw\n\n```true\n\n```\n\n### Please provide the environment you discovered this bug in (run `ng version`)\n\n```true\n\n```\n\n### Anything else?\n\n_No response_","author":{"url":"https://github.com/Yenya030","@type":"Person","name":"Yenya030"},"datePublished":"2026-05-07T13:16:24Z","url":"https://github.com/angular/angular/issues/68620"}
| 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 | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9b031e96-b907-6316-64a3-8b0420e02e82 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A3EC:17C530:B3DD4A:E817EA:6B063907 |
| html-safe-nonce | 67b7f203f34b70b2406a419556a08170e6a322cf3eaae9471e852832dfa19411 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBM0VDOjE3QzUzMDpCM0RENEE6RTgxN0VBOjZCMDYzOTA3IiwidmlzaXRvcl9pZCI6IjEyODg3MjE0MDE1NzAwMTU0OTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 23d6619b6b68b3a3ebba29ea06845ba734573595f0aa7ed0520ea6cd2b618aad |
| hovercard-subject-tag | issue:4399046010 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/angular/angular/68620/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9104d9e62767cc51a514dcc7be65a823f3077d3dec9945eb40e1d87dbdff4971/angular/angular/issues/68620 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9104d9e62767cc51a514dcc7be65a823f3077d3dec9945eb40e1d87dbdff4971/angular/angular/issues/68620 |
| og:image:alt | Which @angular/* package(s) are the source of the bug? service-worker Description Details Angular service worker asset handling reconstructs outgoing requests through AssetGroup.newRequestWithMetad... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Yenya030 |
| hostname | github.com |
| expected-hostname | github.com |
| None | dcf72c457c022486d23c3cbb0dd21aba537a87611ca9ddabd1799cf2eaa9b297 |
| turbo-cache-control | no-preview |
| 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 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 0f38f5735226749ec5e08a8649dce4cb2613d9ad |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width