Skip to content

fix: set frame-ancestors 'none' to prevent embedding - #2926

Merged
ghostdevv merged 2 commits into
mainfrom
fix/frame-ancestors
Aug 6, 2026
Merged

fix: set frame-ancestors 'none' to prevent embedding#2926
ghostdevv merged 2 commits into
mainfrom
fix/frame-ancestors

Conversation

@danielroe

@danielroe danielroe commented Jun 17, 2026

Copy link
Copy Markdown
Member

🔗 Linked issue

🧭 Context

disables embedding using frame-ancestors

📚 Description

noticed that it was possible to embed npmx.dev in a slidev presentation - this aims to harden things by adding an additional csp

edit - this was based on an out-of-date experience! #2075 already fixes this, but unsure if we still want to add frame-ancestors as boot-and-braces?

@vercel

vercel Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs.npmx.dev Ready Ready Preview Aug 6, 2026 1:31pm
npmx.dev Ready Ready Preview Aug 6, 2026 1:31pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
npmx-lunaria Ignored Ignored Aug 6, 2026 1:31pm

Request Review

@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@danielroe
danielroe requested a review from serhalp June 17, 2026 08:42
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2c119387-3ef5-4efe-a186-b9eff5ebfaa7

📥 Commits

Reviewing files that changed from the base of the PR and between 3eff797 and 0900ea4.

📒 Files selected for processing (1)
  • modules/security-headers.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • modules/security-headers.ts

📝 Walkthrough

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Improved security headers to enforce frame-ancestor policies through response headers.
    • Strengthened Content Security Policy protection for application pages, API responses and Nuxt DevTools routes.
    • Added appropriate allowances for DevTools during local development while maintaining protection elsewhere.
  • Tests

    • Expanded automated coverage to verify CSP response headers and DevTools-specific security behaviour.

Walkthrough

The security headers module adds global and Nuxt devtools route-specific Content-Security-Policy response headers for frame-ancestors. Documentation, unit tests, and end-to-end tests now verify these policies.

Changes

CSP frame-ancestors response headers

Layer / File(s) Summary
Define frame-ancestors response policies
modules/security-headers.ts
Documentation now states that frame-ancestors is delivered through response headers. Global routes use frame-ancestors 'none'. Nuxt devtools routes use frame-ancestors 'self'.
Validate route response headers
test/unit/modules/security-headers.spec.ts, test/e2e/security-headers.spec.ts
Unit tests verify the default and devtools route policies. End-to-end tests verify the global policy on HTML page and API responses.

Suggested reviewers: serhalp

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: adding frame-ancestors 'none' to prevent embedding.
Description check ✅ Passed The description explains that the change adds frame-ancestors to strengthen CSP and prevent embedding.
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
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/frame-ancestors

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.

@github-actions github-actions Bot added the stale This has become stale and may be closed soon label Jul 28, 2026
@gameroman gameroman removed the stale This has become stale and may be closed soon label Aug 4, 2026
@gameroman
gameroman requested a review from a team August 4, 2026 13:48
@43081j

43081j commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Probably still nice to have I think 👍

@ghostdevv
ghostdevv enabled auto-merge August 6, 2026 13:29
@ghostdevv
ghostdevv added this pull request to the merge queue Aug 6, 2026
Merged via the queue into main with commit b3c38ce Aug 6, 2026
25 of 26 checks passed
@ghostdevv
ghostdevv deleted the fix/frame-ancestors branch August 6, 2026 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants