Skip to content

Remove deprecated headers and stale policy features - #1728

Merged
mm-kevcenteno merged 4 commits into
mainfrom
kevin/policy-headers
Sep 3, 2026
Merged

Remove deprecated headers and stale policy features #1728
mm-kevcenteno merged 4 commits into
mainfrom
kevin/policy-headers

Conversation

@mm-kevcenteno

@mm-kevcenteno mm-kevcenteno commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes
    • Updated browser security permissions using the modern Permissions-Policy configuration.
    • Removed obsolete security directives and headers to improve compatibility with current browsers.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 93cf7c6e-81ff-439f-bb0f-6aa5ed838d04

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 9f99710e-4d0a-4ea6-8e45-8b2924120280

📥 Commits

Reviewing files that changed from the base of the PR and between 8022033 and bf7934d.

📒 Files selected for processing (1)
  • bin/_headers.config.ts

📝 Walkthrough

Walkthrough

The header configuration replaces Feature-Policy with the existing Permissions-Policy configuration, removes several permissions directives, and deletes the obsolete X-XSS-Protection header.

Changes

Security header policy

Layer / File(s) Summary
Header policy configuration
bin/_headers.config.ts
The configuration retains Permissions-Policy with explanatory comments, removes selected directives, and deletes Feature-Policy and X-XSS-Protection.

Estimated code review effort: 2 (Simple) | ~10 minutes

Mergeability Score: ⚪ Minimal · up to bf793

This PR makes a localized cleanup to deprecated headers and stale policy features in one configuration file; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: kevcenteno

Poem

A rabbit trims the headers tight,
Keeps permissions rules in sight.
Old policies hop away,
XSS guards rest today.
Clean config greets the light.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the removal of deprecated headers and stale policy features described in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch kevin/policy-headers

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 26, 2026

Copy link
Copy Markdown

Deploying dev-site with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2516be7
Status: ✅  Deploy successful!
Preview URL: https://0a5a83e1.dev-site-4ua.pages.dev
Branch Preview URL: https://kevin-policy-headers.dev-site-4ua.pages.dev

View logs

Feature-Policy was superseded by Permissions-Policy. X-XSS-Protection is
non-standard, deprecated, and can itself introduce XSS vulnerabilities in
otherwise safe pages; our Content-Security-Policy covers what it was for.

Also drop the Permissions-Policy features that no browser recognizes,
verified against Chrome 149 and 150: ambient-light-sensor, battery,
document-domain, execution-while-not-rendered,
execution-while-out-of-viewport, and speaker-selection. Chrome reported
each of these as an unrecognized feature, so they never had any effect.
sync-xhr was denied only via Feature-Policy and had no Permissions-Policy
counterpart, so removing that header dropped the denial entirely. Chrome
still enforces Feature-Policy, and sync-xhr defaults to an allowlist of *,
so this was blocking synchronous XHR in the top document and in every
cross-origin frame.
This brings the policy to the same 76 features mm_website denies. The
list was 22 features short of mm_website, and a further 31 recognized
features were denied on none of the three sites.

clipboard-write allows self because the copy button in
assets/js/copy-markdown.ts calls navigator.clipboard.writeText. Every
other addition is a flat deny.

static/_headers is generated, so run npm run build:headers to pick this
up.
Copilot AI lite review requested due to automatic review settings August 26, 2026 19:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

PatrickCroninMM
PatrickCroninMM previously approved these changes Sep 1, 2026

@PatrickCroninMM PatrickCroninMM left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Same finding about the two features that may no longer be necessary.

Comment thread bin/_headers.config.ts Outdated
'identity-credentials-get=()',
'idle-detection=()',
'interest-cohort=()',
'join-ad-interest-group=()',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same maybe about join-ad-interest-group and run-ad-auction. I don't think it hurts to keep them currently.

Comment thread bin/_headers.config.ts
// implication, deny them out of an abundance of caution to limit what
// injected or embedded content can reach. See
// https://github.com/w3c/webappsec-permissions-policy/blob/main/features.md
// for the features that exist.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also would be useful to have a comment on the things we are allowing in these two PRs.

Chromium is removing join-ad-interest-group and run-ad-auction, so the
denials become dead weight once the names go.

This is not free today. Chrome 152 still recognizes both and raises no
warning for them, so a page can call the Protected Audience API where the
denial used to stop it. browsing-topics stays denied, which is the
publisher-side feature of that family with a name that is not going away.

Record why the policy allows what it allows, on both sides: the features
listed with an allowlist, and the features left off the list entirely.
Neither should read as an oversight.

static/_headers is generated, so run npm run build:headers to pick this
up.
Copilot AI review requested due to automatic review settings September 3, 2026 15:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

@mm-kevcenteno
mm-kevcenteno merged commit 665bfe5 into main Sep 3, 2026
10 of 11 checks passed
@mm-kevcenteno
mm-kevcenteno deleted the kevin/policy-headers branch September 3, 2026 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants