What is Permissions-Policy?
Permissions-Policy is an HTTP response header that provides a mechanism to allow and deny the use of browser features in its own frame, and in content within any <iframe> elements in the document.
By explicitly declaring which origins can use which features, it acts as a critical layer of defense-in-depth against malicious third-party scripts and cross-site scripting (XSS) attacks.
When properly configured, this policy allows site administrators to tightly control the attack surface exposed by modern browser capabilities.
Why it matters: browser APIs that can be weaponized
Modern browsers are incredibly powerful, providing access to underlying operating system and hardware capabilities.
If these capabilities are left unrestricted, they can be easily weaponized:
- Camera and Microphone: Malicious scripts can silently record audio or capture video, leading to severe privacy violations.
- Geolocation: Tracking a user's physical location without consent is a massive breach of trust and often illegal under privacy regulations.
- Payment Request API: Attackers might try to hijack checkout flows or prompt fraudulent payment requests.
- USB and Bluetooth: Direct hardware access from the web is highly dangerous if exploited by rogue scripts.
Restricting these APIs ensures that only the code you explicitly trust can interact with the user's sensitive hardware and data.
Full syntax: feature=(allowlist) format
The syntax of the Permissions-Policy header has evolved significantly from its predecessor, Feature-Policy. It now uses a structured dictionary format.
The basic structure is:
Permissions-Policy: feature=(allowlist), feature=(allowlist)
Here are the components:
- feature: The name of the browser feature (e.g.,
camera,geolocation). - allowlist: A space-separated list of origins permitted to use the feature.
Common allowlist values:
(): Denies the feature for all contexts (empty allowlist).self: Allows the feature only for the same origin as the document."src": (Only valid in iframeallowattributes) Allows the feature for the origin specified in the iframe'ssrcattribute.*: Allows the feature for all origins (highly discouraged for sensitive APIs).
Key features to restrict
You should establish a baseline policy that denies access to the most sensitive APIs by default.
Camera and Microphone
Permissions-Policy: camera=(), microphone=()
Unless your application is a video conferencing tool or requires media capture, completely disable these.
Geolocation
Permissions-Policy: geolocation=(self)
If your site needs location data (e.g., for a store locator), restrict it to self. Otherwise, use ().
Payment
Permissions-Policy: payment=("https://trusted-checkout.example.com")
Limit the Payment Request API strictly to your authorized payment processor.
USB and Bluetooth
Permissions-Policy: usb=(), bluetooth=()
WebUSB and WebBluetooth should almost universally be disabled unless you have a highly specialized hardware-integrated web app.
Fullscreen
Permissions-Policy: fullscreen=(self)
Prevents third-party iframes from taking over the user's entire screen, which is a common phishing tactic.
Interest-Cohort (FLoC)
Permissions-Policy: interest-cohort=()
Used to opt out of Google's Federated Learning of Cohorts (FLoC) tracking.
Difference from CSP
While both Permissions-Policy and Content-Security-Policy (CSP) are security headers that restrict browser behavior, they serve different purposes.
Permissions-Policy:
Controls API access. It determines whether JavaScript is allowed to call navigator.geolocation or access the camera.
Content-Security-Policy (CSP): Controls resource loading. It determines where scripts, images, and stylesheets can be loaded from, and where data can be sent.
You need both. CSP stops the malicious script from loading; Permissions-Policy stops it from accessing the camera if it somehow does load.
Setting for all pages vs per-page vs per-iframe
You can enforce Permissions-Policy at multiple levels:
1. Global Header (All Pages)
Set via your web server (Nginx, Apache) to apply a strict baseline to your entire domain.
2. Per-Page Header
Set via your application framework (e.g., Next.js) on a route-by-route basis. For example, relaxing the camera policy only on the /video-call route.
3. Per-Iframe Attribute
Set directly on the HTML element using the allow attribute.
<iframe src="https://example.com" allow="camera 'src'; microphone 'src'"></iframe>
This delegates permissions specifically to that iframe, even if the global header restricts it elsewhere.
Important
Third-party scripts injected directly into your main page run in your page's context. Iframes, however, create a new context. Third-party scripts in iframes can access APIs unless Permissions-Policy explicitly blocks them or the iframe is sandboxed.
Nginx/Apache/Next.js configuration examples
Here is how you can deploy a strict policy across different web stacks.
Nginx
Add this to your server or location block:
add_header Permissions-Policy "camera=(), microphone=(), geolocation=(), payment=(), usb=(), interest-cohort=()" always;
Apache
Add this to your .htaccess or virtual host configuration:
<IfModule mod_headers.c>
Header always set Permissions-Policy "camera=(), microphone=(), geolocation=(), payment=(), usb=(), interest-cohort=()"
</IfModule>
Next.js
In your next.config.js, configure the headers function:
module.exports = {
async headers() {
return [
{
source: '/(.*)',
headers: [
{
key: 'Permissions-Policy',
value: 'camera=(), microphone=(), geolocation=(), payment=(), usb=(), interest-cohort=()'
}
],
},
]
},
}
Testing: how to verify APIs are actually blocked
Deploying the header is only the first step. You must verify it works.
- Browser DevTools: Open the Network tab and inspect the response headers of your document to ensure
Permissions-Policyis present and formatted correctly. - Console Testing: Open the browser console and try to call a blocked API.
If blocked, you should receive aDNS Record / Config
navigator.geolocation.getCurrentPosition(console.log, console.error);NotAllowedErroror similar permission denied exception. - Automated Scanners: Use tools like CyberFurl to continuously monitor your domain for the presence and correctness of the header.
FLoC opt-out with interest-cohort=()
Google introduced FLoC (Federated Learning of Cohorts) as a replacement for third-party cookies. Many privacy advocates and organizations wish to opt out of this tracking mechanism.
By adding interest-cohort=() to your Permissions-Policy, you explicitly declare that your site does not participate in FLoC calculations, protecting your users' browsing history on your site from being aggregated into behavioral cohorts by the browser.
While FLoC has evolved into the Topics API, the principle remains: use Permissions-Policy to actively disable experimental tracking capabilities.
How CyberFurl Helps
Automated monitoring. Zero manual work.
CyberFurl audits your Permissions-Policy headers to verify that sensitive browser APIs — camera, microphone, geolocation, payment — are restricted to only the origins that genuinely need them. The platform flags pages that lack Permissions-Policy entirely (defaulting to permissive behavior) and identifies third-party scripts that may be exploiting unrestricted API access to silently collect data from your users.
