Skip to content

Allow blob: frames in CSP for in-page PDF previews#126

Merged
YurMil merged 1 commit into
mainfrom
fix/csp-frame-blob
Jul 20, 2026
Merged

Allow blob: frames in CSP for in-page PDF previews#126
YurMil merged 1 commit into
mainfrom
fix/csp-frame-blob

Conversation

@YurMil

@YurMil YurMil commented Jul 20, 2026

Copy link
Copy Markdown
Owner

https://cadautoscript.com/utilities/pdf-number-extractor/ could not open its PDF preview:

Framing 'blob:https://cadautoscript.com/...#page=1&search=W1' violates the
Content Security Policy directive: "frame-src 'self' https://challenges.cloudflare.com"

Cause: PdfViewerModal renders the user's own uploaded PDF via URL.createObjectURL() in an <iframe> (src/components/PdfNumberExtractor/components/PdfViewerModal.tsx), and frame-src did not include the blob: scheme.

Fix: add blob: to frame-src. This is a narrow relaxation: a blob: URL can only reference data the page itself created in memory — it cannot be used to frame any external origin. All other directives unchanged.

Also benefits PDF Master / PDF Batch Signer if they ever preview via blob frames.

🤖 Generated with Claude Code

The PDF Number Extractor's viewer modal frames a URL.createObjectURL()
blob of the user's own file; frame-src 'self' blocked it. blob: frames
only ever contain content the page itself created — no external origin
can be framed through this.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
cadautoscript-com Ready Ready Preview, Comment Jul 20, 2026 6:49pm

@supabase

supabase Bot commented Jul 20, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project bkcimygtsnckzexbfqxh because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request updates the Content-Security-Policy in vercel.json to allow blob: sources within the frame-src directive. The reviewer noted that to successfully render PDFs in an iframe on Chromium-based browsers, the object-src directive must also be relaxed from 'none' to 'self' blob:, and provided a code suggestion to resolve this issue.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread vercel.json
@YurMil
YurMil merged commit 7fb1236 into main Jul 20, 2026
7 of 8 checks passed
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.

1 participant