Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: entry script CSP for Firefox #358

Merged
merged 2 commits into from
Sep 15, 2023
Merged

fix: entry script CSP for Firefox #358

merged 2 commits into from
Sep 15, 2023

Conversation

filoozom
Copy link
Contributor

@filoozom filoozom commented Sep 7, 2023

We should also remove the 'self' in script-src for the Waku Objects, as it's no longer necessary.

Ideally, the entry script would be hashed and added to src-script with sha256-*, like we do for the embeds, but that doesn't seem to work for some reason? The current solution might be a bit too open and allow Waku Objects to import Playground scripts, which might be problematic.

@vercel
Copy link

vercel bot commented Sep 7, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
waku-objects-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 12, 2023 8:16am

@agazso
Copy link
Contributor

agazso commented Sep 7, 2023

We should also remove the 'self' in script-src for the Waku Objects, as it's no longer necessary.

👍

Ideally, the entry script would be hashed and added to src-script with sha256-*, like we do for the embeds, but that doesn't seem to work for some reason? The current solution might be a bit too open and allow Waku Objects to import Playground scripts, which might be problematic.

Out of curiosity, what kind of potential problems do you have in mind?

@filoozom
Copy link
Contributor Author

Out of curiosity, what kind of potential problems do you have in mind?

In the current scenario probably nothing concrete, but in theory it would be possible for the Chat App (in this case Playground) to have some JavaScript hosted on its domain that would allow for arbitrary execution. For example,
https://waku-objects-playground.vercel.app/_app/immutable/chunks/close.1436ed61.js could have an eval, and can be imported in the frame by importing https://waku-objects-playground-qr0x2ro8q-waku-objects.vercel.app/_app/immutable/assets/index.d4b589cf.js/../close.1436ed61.js even with the https://waku-objects-playground-qr0x2ro8q-waku-objects.vercel.app/_app/immutable/assets/index.d4b589cf.js CSP.

Copy link
Contributor

@agazso agazso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on Firefox and it works correctly.

@agazso agazso merged commit 1d063b0 into main Sep 15, 2023
2 checks passed
@agazso agazso deleted the fix/firefox-csp branch September 15, 2023 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants