Matches are specific
Why it matters
A content script injecting into <all_urls> runs on every page the user visits — banking portals, health records, internal tools — whether or not the extension has any useful function there. CWE-250 governs this: the content script context executes with unnecessary privileges on irrelevant origins. Chrome's match pattern documentation and OWASP A01 (Broken Access Control) both call for the minimal set of origins. Broad injection also degrades browser performance (each injection is a separate script parse and execution per tab), increases memory usage, and creates a larger attack surface for page-to-extension message injection attacks.
Severity rationale
Medium because over-broad match patterns inject the content script into sensitive origins (banking, health) where the extension has no purpose, compounding any content-script XSS into a cross-origin exposure.
Remediation
Scope matches in manifest.json to the specific domains your extension actually interacts with.
{
"content_scripts": [{
"matches": ["https://specific-site.com/*"],
"js": ["content.js"]
}]
}
If you genuinely need to support arbitrary pages, combine activeTab with a browser-action click instead of broad static match patterns — this avoids the automatic injection and the install-time warning.
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-250 — Execution with Unnecessary Privileges
- owasp:2021 · A01
- external · chrome-match-patterns — Chrome Extensions: Match Patterns
Taxons
History
- 2026-04-18·v1.0.0·Initial import from extension-permissions-security·automated