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

[Bug]: use of setAttribute('style', ...) in rrweb/src/record/mutation.ts violates CSP style-src directive #145

Open
1 task done
gestureleft opened this issue Dec 19, 2023 · 0 comments · May be fixed by #211
Open
1 task done
Labels
bug Something isn't working

Comments

@gestureleft
Copy link

gestureleft commented Dec 19, 2023

Preflight Checklist

  • I have searched the issue tracker for a bug report that matches the one I want to file, without success.

What package is this bug report for?

rrweb

Version

2.6.0

Expected Behavior

I would expect that even with a strict CSP policy (e.g. style-src 'nonce-${SOME_NONCE}), I would still be able to successfully capture replays. (See a similar issue in a different package)

Actual Behavior

A CSP error occurs due to use of setAttribute('style', ...) here

Steps to Reproduce

  • Set up a vue project that uses Sentry with replays enabled and a strict CSP policy (e.g. style-src 'nonce-${SOME_NONCE})
  • Write a basic component that uses `:style="{ 'background-color': someDynamicVariable }"
  • Deploy the application, trigger an error so a replay begins and update someDynamicVariable - observe how a CSP error occurs

Testcase Gist URL

No response

Additional Information

There might be a simpler way to reproduce the issue, but I've described the setup we observed the issue in. Without any knowledge of what the culprit code is actually trying to do, its hard for me to provide a more concise reproduction.

@gestureleft gestureleft added the bug Something isn't working label Dec 19, 2023
@chargome chargome linked a pull request Aug 7, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant