Commit Graph
17 Commits
Author SHA1 Message Date
ldm0 9ff41f73f4 fix(preload): consume document-owned preload responses 2026-11-02 06:02:24 +08:00
ldm0 c2ae644fb6 fix(preload): discover ordinary preloads in child parsers
Route preload links from parser discovery through their child Document and reserved realm. Start admitted work while the parser is active, and discard pending work on Document or realm replacement.

Apply the child policy container and nonce-aware destination checks after preload type/media admission. Cover parser-blocking discovery, child CSP, cancellation, admission matrices, and the upstream cached-stylesheet preload regression.
2026-11-02 06:02:24 +08:00
ldm0 34826ecfbf fix(history): coordinate joint traversal across child frames
Track committed session-history positions across frames and plan classic History and Navigation API traversals against the same timeline. Preserve queued delta positions across asynchronous commits, apply forward pruning across navigables, and release deferred work after commit, cancellation, or non-displayable responses.

Synchronize CDP history resets after all realms finish pruning, and keep non-displayable responses retryable without settling the Navigation API promises.

Check the initiating document's committed sandbox policy for every affected frame. Keep committed classic History positions after frame removal while dropping removed traversal targets. Cover interleaved, cross-document, queued, mixed-API, and controlled network cases.
2026-11-02 06:02:22 +08:00
ldm0 0130746a5b fix(csp): correct importScripts policy checks and events
Use script-src-elem with script-src/default-src fallbacks for imported
classic scripts. Queue Worker CSP violations after the current task while
preserving the importer's sanitized source location and synchronous
NetworkError behavior.

Cover late listeners, microtask ordering, directive precedence, imported
callsites, and report-only behavior in dedicated and shared workers.
2026-11-02 06:02:19 +08:00
ldm0 ecdbbcdb90 fix(csp): inherit creator policies in local workers
Carry header, meta, and report-only policies into blob/data dedicated,
shared, and nested workers while retaining their self origin and report
rules. Keep blob URLs linked to their creating environment until worker
startup, then clone the policies for the worker lifetime.

Preserve nested HTTP worker response policies and cover local worker
requests, reporting metadata, and object URL metadata lifetimes.
2026-11-02 06:02:19 +08:00
ldm0 af9e433dd3 fix(csp): report fetch call locations and original redirect URLs
Capture script locations for synchronous Window and Worker fetch violations.
Leave locations absent for asynchronous redirects and report the original
request URL, retaining the initiating document's report authority.
Omit unknown source-file values from legacy reports and cover location-based
deduplication, redirect privacy, and report ownership.
2026-11-02 06:02:19 +08:00
ldm0 6ebc617546 fix(csp): deduplicate reports per document and worker 2026-11-02 06:02:19 +08:00
ldm0 48cb1e1d74 fix(csp): enforce frozen document base URL policies 2026-11-02 06:02:19 +08:00
ldm0 cc30843c85 fix(csp): match wildcard ports on exact hosts
Handle exact-host sources with :* in the CSP matcher instead of sending them
to URL parsing. Preserve scheme, host, path, and redirect restrictions while
rejecting invalid literal host sources.

Add coverage across resource kinds and source restrictions. Record the image
and script wildcard-port WPT files as passing, and record the two SRI files
with remaining partial-integrity failures as failing.

Validation: cargo fmt --all; workspace clippy with all targets/features and
-D warnings; full nextest (18,367 passed, 13 skipped); 69 focused CSP tests.
23 WPT cases improved from 79/94 to 86/94 subtests without new failures.
All 18 HTTP port probes match Chromium, including blocked-request counts.
2026-11-02 06:02:18 +08:00
ldm0 e43a49f8d5 fix(csp): validate Trusted Types directive name tokens
Discard non-ASCII directives independently before duplicate lookup and retain exact ASCII whitespace boundaries. Match literal Trusted Types allowlist entries only when they satisfy tt-policy-name, while preserving arbitrary policy names without CSP or under a wildcard.

Add exhaustive ASCII token tests, directive parsing regressions, and enforce/report-only delivery coverage. Validated with fmt, full-workspace Clippy and all 17,735 nextest tests. The 219-case Trusted Types suite gains one passing case and five passing subtests in both CLI and CDP, with all other semantic results unchanged.
2026-11-02 06:01:32 +08:00
ldm0 b1e47797e1 fix(trusted-types): report every violated CSP policy
Report each enforced and report-only Trusted Types policy independently, preserving per-policy endpoints and source locations. Queue worker TT and WebSocket CSP reports without synchronous reentry or overtaking earlier reports.

Honor report-only Trusted Types requirements for worker importScripts and string timers. Cover duplicate policies, default-policy conversion, trusted values, asynchronous delivery, and cross-directive ordering.

Validation: cargo fmt --all; workspace clippy with all targets/features and -D warnings; full nextest (17726 passed, 13 skipped). All 219 Trusted Types WPT cases compared in CLI and CDP: 191 to 195 passed, 9 additional passing subtests, no regressions. Promote the four verified cases in the baseline lists.
2026-11-02 06:01:32 +08:00
ldm0 18c905e2a5 fix(workers): preserve imported script origins and no-cors boundaries
Keep worker settings URLs stable while imported classic scripts retain their own dynamic-import base, request URL and muted-error metadata. Allow classic no-cors imports without relaxing module CORS or response security policies.

Preserve CSP source locations and pre-redirect URLs through worker callbacks and report serialization. Add regression coverage for redirects, CSP/CORP/COEP, opaque errors, rejection reporting and nested imports.

Validation: cargo fmt --all; full workspace clippy with warnings denied; nextest 17699 passed, 13 skipped. Before/after CLI and CDP comparisons cover 707 cases without losing an originally passing case. Promote only the worker importScripts base-URL WPT. Both smoke baselines are 42/43, with Puppeteer blocked by the same missing local puppeteer-core dependency.
2026-11-02 06:01:32 +08:00
ldm0 6bd1f710c1 fix(workers): enforce response CSP gates 2026-11-02 06:01:27 +08:00
ldm0 1fe9b55c73 fix(trusted-types): enforce policy creation CSP 2026-11-02 06:01:26 +08:00
ldm0 ff15becb62 fix(fonts): defer set events and preserve ranges and promises 2026-10-23 04:07:15 +08:00
ldm0 c7130a3059 fix(fonts): share native FontFace loading across CSS and JS 2026-10-23 04:07:15 +08:00
ldm0 f660ee584f refactor(csp): extract shared policy engine into moli-csp 2026-10-21 22:15:00 +08:00