/web-browser-development:browser-security-and-privacyfrom web-browser-development
Reference covering browser security and privacy: same-origin policy, CORS/CSP/COOP/COEP, XSS, memory safety (Rust, MiraclePtr), Spectre, third-party cookies, tracking protection, storage partitioning, Privacy Sandbox, and fingerprinting.
Ships in web-browser-development. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Part 3 of 5 of the Web Browser Development reference (plugin
web-browser-development), covering §8–§9. Sibling skills:browser-engine-architecture-and-networking(§0–§3),browser-rendering-pipeline(§4–§7),browser-extensions-platform-and-standards(§10–§14),browser-development-reference(§15–§20). Section numbers are shared across the set; a reference written as §N →skillpoints into that sibling skill.Currency: Verified August 2026. See §17 →
browser-development-referencefor the currency snapshot and what goes stale first.
How to read this. Reference, not tutorial. Sections are independent. Three markers:
- [DURABLE] — architecture, algorithms, or a constraint every engine has independently arrived at. Does not expire.
- [ENGINE] — specific to Blink/Chromium, Gecko, WebKit, or Servo/Ladybird. Verify against that project's source or docs.
- [CONTESTED] — the vendors genuinely disagree, often because their business models differ. Both cases given, including the commercial motive where it's load-bearing.
⚠️ GOTCHA boxes mark the mistakes that produce security holes, jank, or compatibility breakage that can never be undone.
The two framings that organize everything below:
- A browser is a hostile-input execution environment that must never say no. It runs untrusted code from anyone, on documents that are frequently malformed, and it is not permitted to refuse or crash. Every architectural decision — the multi-process model, the error-tolerant parser, the sandbox — descends from that.
- The web's compatibility constraint is stronger than any other platform's. You cannot break existing sites. Not the well-written ones, not the abandoned ones. This is why the platform accretes and rarely subtracts, and why "just fix it properly" is almost never available.
[DURABLE] The foundational rule: an origin is the (scheme, host, port) triple, and code from one origin cannot read data from another. Everything else in web security is an exception to, or a reinforcement of, this.
The historically-permitted cross-origin operations are the source of most web vulnerabilities: you may embed cross-origin (images, scripts, iframes, styles) and you may send cross-origin requests (forms) — you just can't read the results. CSRF exists because sending is allowed with ambient credentials; XSSI and side-channel leaks exist because embedding is allowed.
| Mechanism | Does what |
|---|---|
| CORS | Server opt-in to cross-origin reads. Simple vs. preflighted requests; Access-Control-Allow-* |
| CSP | Author-declared allow-list of sources and behaviours. Nonce/hash-based CSP with strict-dynamic is the modern form; host allow-lists are widely bypassable |
| Trusted Types | Prevents DOM XSS structurally by requiring typed objects rather than strings at injection sinks. Reached Baseline in February 2026 |
| SameSite cookies | CSRF defence; Lax by default in most engines |
__Host-/__Secure- prefixes | Cookie integrity guarantees |
| HSTS, CT, CAA | Transport and PKI integrity |
| Subresource Integrity | Hash-pinned third-party scripts |
| COOP / COEP / CORP / CORB-ORB | Cross-origin isolation and read blocking (§8.6) |
| Permissions Policy | Delegating or denying powerful features per-frame |
Sandbox attribute / sandbox CSP | Capability reduction for embedded content |
| Secure contexts | Powerful APIs restricted to HTTPS |
[DURABLE] XSS remains the dominant web vulnerability class, and the browser's role is to make it structurally impossible rather than to filter it. The history is instructive: engines shipped XSS auditors (Chrome's XSS Auditor, IE's XSS Filter), and all of them were removed — they were bypassable, they introduced their own vulnerabilities, and they caused false positives that broke sites. The lesson generalizes: a filter that must guess intent on a Turing-complete input is not a security boundary. Trusted Types and CSP are the structural replacements.
[DURABLE] The single most important implementation rule in browser security. A compromised renderer will lie about its origin, its URL, its permissions, and the contents of any structure it hands you. Every privileged operation must be re-derived and re-validated in the browser process from state the browser process owns.
Chromium is now moving this enforcement into Rust: the security team has been
migrating ChildProcessSecurityPolicy to Rust with a live Canary experiment, both for
memory safety and to strengthen the security-relevant invariants that Site Isolation
depends on — and has an initial Rust Mojo client enabling services to be implemented
fully in Rust.
[VERSIONED — the most active area of browser security engineering.] Roughly 70% of serious browser vulnerabilities have historically been memory-safety bugs. The 2026 state of the art, using Chrome as the documented example:
std:: containers.-fsanitize=return enabled by default in release builds, with plans to expand.ChildProcessSecurityPolicy migration above. The stated architectural payoff is
significant: writing new components in Rust lets complex features run inside
high-privilege processes without the performance penalty of sandboxing — i.e. memory
safety buys back architectural freedom that process isolation was spending.Engine comparison [ENGINE]: Gecko relies on Rust for newer components (Stylo, WebRender) but older C++ doesn't benefit from a BackupRefPtr equivalent, and mozjemalloc is less hardened than PartitionAlloc. WebKit leans on OS integration — pointer authentication on ARM64, strict code signing on iOS — and mostly uses system allocators.
[DURABLE, and the reason the architecture looks like it does.] Spectre showed that any high-resolution timer plus speculative execution lets attacker JS read arbitrary memory in its own process. There is no software fix for the CPU behaviour. So the browsers' response was architectural: if the secret isn't in the process, it can't be read. That is Site Isolation's origin story.
The supporting mitigations: reduced timer resolution and jitter, disabling
SharedArrayBuffer unless cross-origin isolated (COOP+COEP), CORB/ORB to stop
sensitive cross-origin responses from ever entering a renderer, and per-site process locks.
[VERSIONED, and the folklore is badly out of date. This is worth getting exactly right.]
Timeline:
[DURABLE] The lesson for an engine implementer is not about advertising. It's that a browser vendor whose revenue depends on advertising faces a structural conflict when changing tracking defaults, and that regulators now treat browser defaults as competition policy. Note also the asymmetry that remains: Safari, Firefox, and Brave still block third-party cookies by default, so roughly 17–20% of global traffic is "cookieless" regardless of Chrome — the fragmentation didn't go away, it just stopped being Chrome-led.
Partitioned cookies) is the opt-in
standardized form.Referrer-Policy defaults.[CONTESTED, and genuinely unresolved.] Canvas, WebGL, fonts, audio, screen metrics, timing, hardware concurrency, and the sheer combination of exposed APIs form an identifier without any storage at all.
Two philosophies:
The honest assessment: nobody has solved this. Every new capability API adds entropy,
which is why capability APIs (§11 → browser-extensions-platform-and-standards) are permanently in tension with privacy, and why "just
ship the feature" is never the whole answer.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
browser-security, web-security, privacy, same-origin-policy, cors, csp, fingerprinting
npx claudepluginhub the-vibey-project/vibey --plugin web-browser-developmentOther plugins' skills for the same job
5 skills in this plugin
/browser-development-referenceUse when reviewing browser or web-platform work for known anti-patterns, weighing contested questions (Manifest V3, how much capability the web should have, the engine monoculture, Site Isolation's cost, JIT or no JIT, fingerprinting strategy, blocking ads by default, living standards vs versioned specs), checking whether an engine, standard, or privacy-policy claim is still current (snapshot verified August 2026), finding the primary sources, books, people, and channels, or needing the numbers, 'why is this page slow' triage order, and browser security review checklist. Companion to the other web-browser-development skills./browser-engine-architecture-and-networkingUse when working on or reasoning about browser architecture: the anatomy of a browser (the router for the whole web-browser-development reference), who actually renders the web (Blink, WebKit, Gecko, Servo, Ladybird) and what it costs to build one, what a browser is besides an engine, why multiple processes, Site Isolation, sandboxing per platform, IPC design, and the networking stack — HTTP/1.1, HTTP/2, HTTP/3 and QUIC, TLS, DNS, and caching.