Style sources are safe
Why it matters
CWE-693 and OWASP A05 apply: a permissive style-src directive (e.g., style-src * or style-src https:) allows any external stylesheet to be loaded into extension pages. While style injection is less immediately dangerous than script injection, CSS exfiltration attacks exist — attribute selectors can leak sensitive DOM content character by character. More practically, allowing external styles defeats the extension's origin isolation and can be used to fingerprint extension state via timing side-channels. Restricting style-src to 'self' forces style bundling, which also improves offline reliability and eliminates dependency on third-party CDNs.
Severity rationale
Medium because wildcard style sources enable CSS-based data exfiltration attacks and defeat origin isolation, though exploitation requires chaining with another injection opportunity.
Remediation
Restrict style-src to 'self' and bundle all stylesheets locally. If a UI framework requires 'unsafe-inline' for inline styles, that is tolerated but should be paired with a strict script-src.
"content_security_policy": {
"extension_pages": "style-src 'self'; script-src 'self'; object-src 'none'"
}
Avoid loading fonts or CSS from external CDNs — host them under src/assets/ and reference via relative path.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Extension Permissions & Security Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-693 — Protection Mechanism Failure
- owasp:2021 · A05
- external · chrome-csp-style-src — Chrome Extensions: CSP style-src
Taxons
History
- 2026-04-18·v1.0.0·Initial import from extension-permissions-security·automated