32859 Commits
Author SHA1 Message Date
Pawel Kozlowski 6d1753b46b release: cut the v19.2.25 release v19.2.25 2026-06-02 13:20:10 +02:00
Alan Agius e2fb854d55 fix(platform-server): throw on suspicious URLs and restrict protocol-relative URLs
Backports the security fixes from:

- https://github.com/angular/angular/pull/68973

- https://github.com/angular/angular/pull/69018
2026-06-02 12:21:41 +02:00
Alan Agius a0193fa1bc refactor(platform-server): extract parseUrl regex and add comments for URL parsing behavior
Extracts the regular expression for matching malformed absolute URLs to a module-scoped constant in url.ts.

Additionally, adds comprehensive inline documentation to clarify:
- The path normalization behavior of LEADING_SLASHES_REGEX which collapses consecutive slashes and backslashes.
- The rationale for using 'http://localhost' as the fallback base URL for virtual document initialization in server.ts.
2026-06-02 12:21:41 +02:00
Alan Agius 0a8befb493 fix(platform-server): update domino to latest version
Updates the domino dependency to the latest version as used in the main branch.

This update contains fixes for https://github.com/angular/domino/pull/29.
2026-05-29 14:24:25 +02:00
Pawel Kozlowski a497a3e3b6 release: cut the v19.2.24 release v19.2.24 2026-05-28 16:44:17 +02:00
Alan Agius 6ea6379123 fix(compiler): prevent namespaced SVG <style> elements from being stripped
Updates the template preparser to exclude namespaced SVG style tags (':svg:style') from the style elements set.

Previously, ':svg:style' elements were incorrectly classified as PreparsedElementType.STYLE, which caused them to be completely stripped from the final template DOM tree during the Render3 template transform and pushed into standard component stylesheets. By limiting the style element parsing to standard 'style' tags, namespaced SVG style tags remain safely in the template AST as normal DOM elements, preserving local SVG styling.

Closes #68977
2026-05-28 15:54:46 +02:00
Alex Rickabaugh 7801eaac2a release: cut the v19.2.23 release v19.2.23 2026-05-27 15:48:17 -07:00
Matthieu Riegler 3960b21558 fix(core): sanitize meta selectors
Ensure that property/name are correctly escaped and doesn't break out of the intended selector.
2026-05-27 15:13:35 -07:00
SkyZeroZx 5619120931 fix(service-worker): Preserves HTTP cache mode in asset group requests
Ensures explicit HTTP cache mode from incoming requests is forwarded and maintained when creating fetch requests for assets, aligning with expected fetch behavior and preventing unintended cache handling.
2026-05-27 11:02:13 -07:00
SkyZeroZx 97f796203f fix(service-worker): Preserves explicit 'credentials: omit' in asset requests
Ensures that explicitly provided `credentials: 'omit'` options are preserved
when creating new requests, preventing unintended credential inclusion.
2026-05-27 11:02:13 -07:00
Matthieu Riegler 62dd27d6af fix(common): add upper bounds for digitsInfo
The prevents the `roundNumber` function from allocating a large array.
2026-05-27 10:32:20 -07:00
Matthieu Riegler 17326725ba fix(common): sanitize placeholder
The placeholder should be sanitized to prevent CSS/content injection.
2026-05-27 10:30:45 -07:00
Alan Agius c75f60ef8a fix(platform-server): secure location and document initialization against SSRF and path hijack
Normalizes the URL and path parsing logic inside platform-server by consolidating security checks and normalizations into a single, unified parseUrl helper function.

This includes:
- Collapsing multiple consecutive leading slashes and backslashes (e.g., // or /\) to a single forward slash to avoid protocol-relative parsing of path-like & relative inputs.
- Rejecting malformed absolute URLs that are otherwise accepted by lenient DOM parsers like Domino but rejected by standard WHATWG parsers, preventing SSRF / allowedHosts validation bypasses.
- Ensuring parseDocument gets the fully parsed and normalized URL instead of raw, unvalidated configuration values, preventing virtual document hostname adoption/origin hijack.
- Moving parseUrl unit tests into a dedicated url_spec.ts test file to keep platform_location_spec.ts clean and decoupled.
2026-05-27 10:26:12 -07:00
Alan Agius c5b6d735a0 refactor(core): prevent runtime error when root element is null during tag check
This ensures that when rootElement is undefined no error occures.
2026-05-27 10:26:12 -07:00
Alan Agius e8d35f9693 Revert "revert: revert all changes until fdc1b48f32e52da7684583811a6a3090f6418d5e"
This reverts commit 4747fe207d.
2026-05-27 10:26:12 -07:00
Alan Agius 4747fe207d revert: revert all changes until fdc1b48f32
This reverts all changes from fdc1b48f32 to the previous branch tip (d31f84116c) due to repository force-push restrictions.
2026-05-27 10:53:37 +00:00
Alan Agius d31f84116c fix(core): wrap i18n dynamic element property updates in active index states
Ensure that the elementPropertyInternal call in i18n_apply.ts is wrapped within a setSelectedIndex(nodeIndex) try/finally block. This coordinates input/property reflection lookups with the correct element node at runtime, preventing ICU and renderer element dynamic update errors.

Additionally, apply a safe guard to locateHostElement to check for defined targets during dynamic targetless testing contexts, and update the integration payload tracking sizes golden file.
2026-05-27 08:12:57 +00:00
Alan Agius e2caa08ef2 test(core): update core packaging golden symbols to match security schema refactor
Update the golden symbols files for animations-standalone, defer, forms_reactive, forms_template_driven, and hydration tests.

These symbol list updates align with the newly backported security schema refactor, where a generic RESOURCE_MAP was introduced and individual resource tag collections were combined.
2026-05-27 07:58:39 +00:00
Alan Agius 08422de793 refactor(http): export CACHE_OPTIONS to support test suite requirements
Export the CACHE_OPTIONS injection token from transfer_cache.ts to resolve compilation failures in the unit test specs.

On the 19.2.x branch, the CACHE_OPTIONS token was previously a local private constant. However, the newly cherry-picked testing configurations import this token directly, requiring it to be exported.
2026-05-27 07:57:12 +00:00
Alan Agius 7dab3e376c test(core): update router golden symbols to match security schema refactor
Update golden file and schema tests
2026-05-27 07:32:55 +00:00
Yenya030 9940ffd781 fix(http): exclude withCredentials requests from transfer cache
Update the transfer cache check to safely exclude all requests sent with the `withCredentials` flag.

By default, the HTTP transfer cache avoids caching user-specific responses to prevent sensitive data exposure or incorrect caching. While requests with explicit headers like `Cookie` or `Authorization` are excluded by default, requests can also be sent with credentials via the `withCredentials` flag without having those headers explicitly declared on the request object.

To keep user-specific responses from being cached, exclude `withCredentials` requests unconditionally, even when the `includeRequestsWithAuthHeaders` option is set to true.
2026-05-27 07:23:09 +00:00
Yenya030 0f67f0b962 fix(http): skip TransferCache for cookie-bearing requests by default
Treat requests with a Cookie header like other auth-bearing requests and skip TransferCache caching them by default.

This preserves the explicit opt-in path via includeRequestsWithAuthHeaders, adds regression coverage for cookie-bearing requests, and updates the SSR guide to document the behavior.
2026-05-27 07:22:42 +00:00
Alan Agius d187e8aeda fix(platform-server): normalize path parsing in ServerPlatformLocation
Normalizes request path parsing in ServerPlatformLocation by collapsing multiple consecutive leading slashes and backslashes (e.g. // or /\) down to a single forward slash. This ensures consistent resolution of relative path segments and prevents unexpected absolute path overrides during URL parsing.
2026-05-27 07:21:57 +00:00
Yenya030 afe690ec07 refactor(service-worker): remove unnecessary cast in mock redirect check
Use the typed Response.redirected property directly in the service-worker test mock instead of casting to any.
2026-05-27 07:21:55 +00:00
Yenya030 37ee9ffd9e fix(service-worker): preserve redirect policy on reconstructed asset requests
Preserve the redirect mode when rebuilding asset requests in newRequestWithMetadata(). This keeps explicit redirect:error semantics intact across service-worker redirect handling.

Update the worker test mocks to model redirect defaults correctly and add focused regression coverage for redirected lazy assets with redirect:error.
2026-05-27 07:21:53 +00:00
Alan Agius ce6acbf5c1 test(compiler-cli): align ngtsc sanitization expectations with modern DOM schema
Removes the legacy profile property/attribute from the directives hostBindings specs to align with modern DOM security schema changes. Also cleans up minor redundant formatting lines in the compiler and core targets.
2026-05-27 07:21:48 +00:00
Alan Agius de74480496 test(core): update golden symbols and host bindings sanitization spec
Synchronizes the golden symbols for router bundling and updates the host bindings sanitization integration test to use a[href] instead of blockquote[cite].
2026-05-27 07:21:19 +00:00
Alan Agius c6bb0692e2 fix(core): reject script element as a dynamic component host
To enhance application security and prevent accidental or malicious script execution, this change ensures that dynamically mounting a component via createComponent directly onto a <script> element throws a runtime error in development mode. SVG <script> elements are also rejected. The error message is designed to be fully tree-shakable under production builds where ngDevMode is disabled.
2026-05-27 07:21:12 +00:00
Alan Agius 5e399a24da test(core): remove obsolete blockquote cite host binding tests
Removes the obsolete blockquote[cite] sanitization expectations in host_binding_spec.ts.
2026-05-27 07:21:10 +00:00
Alan Agius dc3a544a74 test(core): update spec files to match 20.3.x limits and actual contexts
Updates spec files to replace modern Eager change detection and remove obsolete ins[cite] expectations.
2026-05-27 07:21:09 +00:00