Skip to content

Commit bee3745

Browse files
Amos N.claude
andcommitted
Drop CSP frame-ancestors directive entirely
`frame-ancestors *` still rejects non-network parent schemes (data:, blob:, chrome-extension:, chrome-error://) — so iframe embedding from extensions, error pages, or sandboxed parents was still blocked. Omitting the directive falls back to "no restriction" and there's no X-Frame-Options set, so embedding works from any context. Safe because relay credentials live in localStorage, not cookies — no clickjacking auth surface. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 8541b8c commit bee3745

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "loopsy",
3-
"version": "1.0.27",
3+
"version": "1.0.28",
44
"private": true,
55
"description": "Control your terminal from your phone. Self-hosted on Cloudflare Workers.",
66
"scripts": {

packages/relay/src/index.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,19 @@ import { LANDING_HTML } from './landing.js';
2929
* JetBrains Mono).
3030
*/
3131
function buildCsp(host: string, nonce: string): string {
32+
// Note: no `frame-ancestors`. Self-hosted relays are often mounted inside
33+
// parent dashboards/portals, including non-network schemes (data:, blob:,
34+
// chrome-extension:) where `frame-ancestors *` still blocks. Omitting the
35+
// directive falls back to "no restriction" — and there's no X-Frame-Options
36+
// set, so embedding works from any context. Safe because relay credentials
37+
// live in localStorage (no cookies = no clickjacking auth surface).
3238
return [
3339
"default-src 'self'",
3440
`script-src 'self' 'nonce-${nonce}' https://cdn.jsdelivr.net`,
3541
"style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://fonts.googleapis.com",
3642
"font-src 'self' data: https://fonts.gstatic.com https://cdn.jsdelivr.net",
3743
`connect-src 'self' wss://${host} https://cdn.jsdelivr.net`,
3844
"img-src 'self' data:",
39-
// Allow embedding in iframes on any origin. Self-hosted relays are often
40-
// mounted inside parent dashboards/portals; the loopsy.dev deploy is also
41-
// safe to embed because credentials live in localStorage (no cookies).
42-
"frame-ancestors *",
4345
"base-uri 'self'",
4446
"form-action 'self'",
4547
].join('; ');

0 commit comments

Comments
 (0)