Skip to content

fix(web): allow integration logos through CSP - #117

Merged
iamjr15 merged 1 commit into
mainfrom
fix/integration-logo-csp
Aug 3, 2026
Merged

fix(web): allow integration logos through CSP#117
iamjr15 merged 1 commit into
mainfrom
fix/integration-logo-csp

Conversation

@iamjr15

@iamjr15 iamjr15 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • allow the exact Composio logo origin in the browser img-src policy so skill cards render their brand marks
  • remove the redundant Next.js remotePatterns entry because these SVGs use unoptimized and bypass the optimizer
  • route browser takeover through Cheatcode's authenticated preview proxy instead of adding Daytona vendor hosts to frame-src

Architecture

The web app remains deny-by-default at the browser boundary. Integration logo URLs and the CSP origin share one constant. All sandbox iframes, including noVNC browser takeover, now stay behind the existing *.trycheatcode.com preview-proxy boundary.

Decisions Made

Decision Choice Alternative Reasoning
Logo permission exact https://logos.composio.dev img-src origin wildcard image hosts smallest permission that serves the catalog
Next image config remove remotePatterns maintain two allowlists unoptimized returns the raw source and does not use the optimizer allowlist
Browser takeover owned preview proxy allow Daytona preview apexes in frame-src avoids vendor-domain CSP expansion and matches the documented preview architecture

Edge Cases Handled

Scenario Handling
malformed or unusual integration slug URL path segment is encoded before rendering
logo endpoint fails existing initials fallback remains in place
noVNC WebSocket traffic existing preview proxy WebSocket relay remains the transport
local preview routing existing local preview handoff supports the generated proxy URL

How to Review

  1. Review apps/web/next.config.ts and apps/web/src/lib/integration-logo.ts for the CSP boundary.
  2. Review integration-brand-logo.tsx for the shared URL builder.
  3. Review project-sandbox-content.ts for the browser-takeover proxy alignment.

Verification

  • pnpm lint
  • pnpm typecheck
  • pnpm turbo build --force
  • pnpm turbo skills:build
  • pnpm deadcode
  • pnpm architecture:check
  • optimized local server returned the production CSP with the Composio origin
  • Chrome loaded https://logos.composio.dev/api/gmail under that CSP at 128×128

Authorize the exact Composio image origin and remove the redundant Next
optimizer allowlist. Keep browser takeover on the owned preview proxy
instead of widening CSP to Daytona domains.
@iamjr15
iamjr15 merged commit adf08e4 into main Aug 3, 2026
4 checks passed
@iamjr15
iamjr15 deleted the fix/integration-logo-csp branch August 3, 2026 07:34
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