How to turn off camera and location capabilities by default in the response header for web pages that do not need them?

📅 2026-10-11 👁️ 19

Web pages do not need camera, microphone, and location capabilities, which can be turned off by default in the Permissions-Policy response header. Its mechanism is to set an allowed list for each instruction, and the document itself as well as each frame nested within the document judge whether they can use the corresponding feature according to this list. Tightening the default list of the site to 'no one' is the most direct way to reduce the exposure of the browser's capabilities.

The default list only has three values

According to the document, each instruction has a default allowed list, which is always one of the three: an asterisk indicates that any source is allowed, self indicates only the same origin, and none indicates that no one is given by default. That is to say, the essence of writing this header is not to 'turn off a feature', but to narrow down the default list of each instruction.

The following table separates common instructions according to whether the page is needed or not, making it easy to judge which level to give to each item:

Ability Category Typical Instructions Common Lists on Content Sites
Hardware Collection Camera, Microphone An empty list is given when there is no related function
Location Information Positioning Origin is required for pages of type Store positioning
Screen capture Screen sharing Generally provide an empty list
Full screen and autoplay Full screen, autoplay Origin required as needed for video pages
Cross-site request Wildcard subdomain related instructions Provide an empty list when not in use

Why would a nested frame be blocked by the parent page?

There is a frequently ignored premise in the document: in order to enable a certain feature, the allowed source of the frame must also appear in the parent page's allowed list. This means that the parent page list is the upper limit, and the child frame cannot obtain authorization beyond the limit.

Content station's third-party components are taking this path: embedded captcha components, map components, and players are all embedded in the framework. If the parent page is set to empty to tighten the list, these components will directly fail. The sequence in practice should be to first determine the widest acceptable range of the entire site and write it into the response header, and then use the allow attribute to specify the subset it needs on a narrower framework.

The allow attribute can only narrow, not broaden.

This is the second boundary: the allow attribute on the framework is used to further narrow the range allowed in the parent page, rather than to add permissions to the child page. No authorization given by the parent page will not appear, no matter how many properties are written.

This is the most likely to be misjudged when troubleshooting. The component reports 'The browser rejected this capability', and the first thing to look at is the list in the parent page's response headers, not the parameter writing in the component documentation.

This does not overlap with the existing protection within the site.

AnQiCMS such systems have protection on the input side, sensitive word filtering and filtering logic for SQL injection and XSS are for content-level issues; Permissions-Policy handles the permissions of browser function calls, which belongs to the level of 'whether the page can access the device capabilities'. Both do not exceed boundaries: tightening the list of capabilities cannot replace content purification, and content filtering will not cause the framework call to fail due to exceeding the authority.

Form sites that have integrated the captcha component should pay attention. The verification order after tightening the list should be: first, confirm that the component can still load and submit normally in a clean browser instance, and then confirm that the backend still performs validation on the submission. Whether the human verification component is available on the page belongs to the browser side, and the server still needs to independently judge whether this submission is legal, and cannot be automatically approved just because there is a component on the page.

Common questions

Question: What if no instructions are written?Answer: Instructions run according to their default allowed lists, and the default settings of different instructions are not consistent. Writing down each item explicitly makes behavior explicit and avoids reliance on the default settings of various features.

Ask: Isn't it safer to only allow same-origin?Answer: Same-origin is just one of the three levels, suitable for situations where only the site's scripts will call this capability. If there is indeed no scenario that uses it, the empty list is narrower than same-origin.

Ask: Why are some pages still prompting for permissions after changing the header?Answer: The page is allowed in the list, or the response header did not cover this path. It is more stable to check each path than to add one at the main site.

Related articles

What's the difference between returning 451 when a page is taken down due to compliance requirements and directly giving a 404?

Pages taken down due to compliance requirements should return 451 or 404? The difference is not in whether the page is accessible, but in which layer the reason for unavailability is written in the status code. This article explains the semantic boundaries of 451, the responsibility party's explanation of where it should be written in the response body or link, and the handling of taken-down pages in the site map and content review process.

2026-10-11

What are the entry requirements for taking back the mandatory jump to HTTPS after joining the preload list?

To bring back the mandatory jump to HTTPS of the site, it is necessary to distinguish between two layers: the response header only takes effect for browsers that have already visited, and after entering the preloading whitelist, the threshold is a validity period of at least one year and must include subdomains. This article explains the criteria for both, why it is necessary to go through a secure request when撤销ing, and which layer to change when modifying the configuration within the site.

2026-10-11

Why should directory upload be prohibited from type sniffing, and what are the differences in configuration methods between the two types of web servers?

The upload directory needs to add a response header to prohibit type sniffing because browsers default to inferring types based on content, so uploaded files may be executed as scripts. After prohibition, browsers only process types declared, and script and style class request types that do not match will be blocked directly. This article compares the differences between Apache and Nginx in issuing this rule and provides the check sequence for deployment.

2026-10-11

The scoring criteria has been upgraded to a major version, can the severity of the two announcements be compared directly.

The vulnerability scoring criteria changed from 3.1 to 4.0, and the scores given by the two announcements cannot be simply compared horizontally. The qualitative grading intervals are compatible between versions, still divided into four grades from zero to ten, but the scope of assessment does not include economic losses. This article explains what the score and grading are compared to across versions and falls into the follow-up action for a high-risk fix at home once.

2026-10-11

What request header is used for resuming a large file download, and what will the server return if it does not support it?

Resuming a file download depends on the Range header in the request, combined with the Accept-Ranges header in the response to determine if the server supports range requests. The server returns 206 for valid ranges and 416 for invalid ranges; servers that do not support range requests will simply ignore this header and return the entire 200 response. This article explains the method of judgment, byte offset notation, and the additional benefits of a single segment range.

2026-10-11

The security version of the content system fixes multiple issues at once, and the appearance of an AI research institution in the report indicates what.

In a content system's security release statement, multiple fixes have appeared from AI research institutions and security audit companies. This is more like a change in the division of labor in the vulnerability discovery process: auxiliary audit has started to enter the disclosure process. This article reads this announcement item by item and gives three places to check when following up on the site.

2026-10-11

The open-source content system posted a security patch preview days in advance, what should the operation and maintenance team do in these days?

The security patch preview only provides the time window and risk level, without giving details of the vulnerability. The preparations that can be made in these days are therefore very specific: confirm whether the module is within the scope, back up the data and static files, practice the upgrade path on the copy, prepare the checklist for the release day, and reserve time for rollback and review.

2026-10-11

The security announcement for the form module only covers two version ranges, should the site be upgraded first or disable the submission function first?

A security announcement for a form module provides two affected ranges and two fixed versions. The order of handling should be decided by the branch and exposure surface: if it can be upgraded to the corresponding fixed version immediately, it should be upgraded first. If the upgrade needs to be scheduled, consider temporarily closing the external submission entry and record the scope of closure and recovery conditions.

2026-10-11