Permissions-Policy header restricts sensitive APIs
Why it matters
Without Permissions-Policy, any JavaScript executing on your page — including third-party analytics scripts, embedded widgets, and compromised CDN assets — can request access to the user's camera, microphone, and geolocation without additional browser prompts. If an XSS payload fires or a third-party script is compromised, it can silently activate hardware sensors. CWE-732 (Incorrect Permission Assignment) and OWASP A05 (Security Misconfiguration) both apply to unrestricted browser API exposure. Restricting permissions you don't use follows the principle of least privilege: a payment app has no legitimate reason to access the gyroscope.
Severity rationale
Low because exploiting unrestricted permissions requires additional code execution context, but the policy is trivial to add and eliminates unnecessary browser API surface.
Remediation
Add a Permissions-Policy header that explicitly denies browser APIs your app doesn't use. Deny everything you don't need — you can always add specific origins later.
// next.config.js
headers: [{
key: 'Permissions-Policy',
value: 'camera=(), microphone=(), geolocation=(), payment=(), usb=()'
}]
The () syntax denies the feature for all origins, including your own pages. Use (self) to allow the feature only for your own origin. If you do need camera access (e.g., for a video feature), set camera=(self) instead of allowing it globally.
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 Security Headers & Basics Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-732 — Incorrect Permission Assignment for Critical Resource
- owasp:2021 · A05 — Security Misconfiguration
- soc2:2017 · CC6.6 — Protection against threats from outside system boundaries
Taxons
History
- 2026-04-17·v1.0.0·Initial import from security-headers·automated
- 2026-07-06·v1.0.1·Add SOC 2 TSC mapping (CC6.6) from the verified compliance crosswalk register (docs/compliance/).·by soc2-mapping-enrichment-ship-2