Skip to content

feat(server): broaden CSP frame-ancestors so owletto extension can embed the whole app#884

Merged
buremba merged 1 commit into
mainfrom
feat/iframe-whole-app-csp
May 18, 2026
Merged

feat(server): broaden CSP frame-ancestors so owletto extension can embed the whole app#884
buremba merged 1 commit into
mainfrom
feat/iframe-whole-app-csp

Conversation

@buremba
Copy link
Copy Markdown
Member

@buremba buremba commented May 18, 2026

Companion to lobu-ai/owletto#TBD (feat/sidepanel-whole-app).

Why

The Chrome extension's sidepanel used to iframe /embedded, a stub route. The companion PR replaces that with iframing the gateway's root — same UI users get in a regular tab. CSP frame-ancestors was scoped to /embedded only, so without this change the iframe is refused by Chrome.

What

  • Drop the path === '/embedded' check.
  • Add the canonical Owletto for Chrome extension ID (amnnhclgmbldmfcfamonoggjhfidemmm — derived from the manifest key we shipped in PR feat(observability): vendor-neutral OTEL tracing + opt-in Sentry #172) to frame-ancestors for all HTML routes.
  • New env var LOBU_OWLETTO_EXTENSION_IDS accepts a comma-separated list of additional IDs (validated against Chrome's ^[a-p]{32}$ ID shape) — for dev builds with a different manifest key.

Still narrow

frame-ancestors reads 'self' <https://lobu.ai et al> chrome-extension://amnnhclgmbldmfcfamonoggjhfidemmm. Arbitrary extensions remain blocked from iframing the app.

…to embed the whole app

The Chrome extension's sidepanel iframes the gateway's UI. The CSP
'frame-ancestors' directive used to scope chrome-extension framing
to the '/embedded' route only — fine when /embedded was a stub. That
stub is going away (see lobu-ai/owletto: feat/sidepanel-whole-app);
the sidepanel now iframes the whole app at /.

This change:
- Drops the path-based check for '/embedded'.
- Adds our own extension ID to frame-ancestors for all HTML routes
  (the deterministic ID derived from apps/chrome/manifest.json's
  'key' field: amnnhclgmbldmfcfamonoggjhfidemmm).
- LOBU_OWLETTO_EXTENSION_IDS env var accepts a comma-separated list
  for dev builds with a different manifest key, validated against
  Chrome's '^[a-p]{32}$' ID shape.

Still narrow — arbitrary extensions can't iframe the app, only ours.
Clickjacking defense preserved against everything else.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Warning

Rate limit exceeded

@buremba has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 59 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5d7ede83-bfb9-4bac-8ee3-fdbc29adb66f

📥 Commits

Reviewing files that changed from the base of the PR and between 0c32c18 and 6ed5d82.

📒 Files selected for processing (1)
  • packages/server/src/index.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/iframe-whole-app-csp

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

@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@buremba buremba merged commit 458f37e into main May 18, 2026
19 of 20 checks passed
@buremba buremba deleted the feat/iframe-whole-app-csp branch May 18, 2026 16:43
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.

2 participants