Skip to content

fix(cli): allow blob frames and objects in web UI CSP - #52948

Closed
Serenity-2026 wants to merge 1 commit into
anomalyco:devfrom
Serenity-2026:fix-web-ui-csp
Closed

Serenity-2026 wants to merge 1 commit into
anomalyco:devfrom
Serenity-2026:fix-web-ui-csp

Conversation

@Serenity-2026

Copy link
Copy Markdown

Issue for this PR

Closes #50828

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The v2 web UI CSP (packages/cli/src/services/web-ui.ts) has no frame-src or object-src directive, so blob: iframes and objects fall back to default-src 'self' and are blocked. Desktop is built from v2 and serves the CSP from this file, so blob: previews (icons, PDFs) stay blocked there even after the dev fix in #51636. Added frame-src 'self' blob: and object-src 'self' blob:.

How did you verify your code works?

Extended the existing packages/cli/test/web-ui.test.ts CSP assertions to cover both directives. From packages/cli: bun test test/web-ui.test.ts (2 pass, 74 assertions) and bun run typecheck.

Screenshots / recordings

CSP header change:

before: ... media-src 'self' data:; connect-src * data: blob:
after: ... media-src 'self' data:; frame-src 'self' blob:; object-src 'self' blob:; connect-src * data: blob:

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

The web UI CSP has no frame-src or object-src directive, so blob: iframes and
objects fall back to default-src 'self' and are blocked. Desktop is built from
v2 and serves the CSP from this file, so blob: previews (icons, PDFs) stay
blocked there. Add frame-src 'self' blob: and object-src 'self' blob: next to
the existing worker-src, and assert both in the web UI test.

Closes anomalyco#50828
@Serenity-2026

Copy link
Copy Markdown
Author

Rebased onto the current v2 (which had meanwhile added worker-src 'self' blob: to this CSP), so the branch is conflict-free again and the change now sits next to worker-src:

... media-src 'self' data:; frame-src 'self' blob:; object-src 'self' blob:; connect-src * data: blob:; worker-src 'self' blob:

Test assertions updated for both directives.

@Frozen-byte

Copy link
Copy Markdown

Still waiting for this fix, cant look at HTML Files

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

web-ui: CSP missing frame-src blocks blob: iframes ("This content is blocked")

2 participants