getsentry / rrweb

record and replay the web
https://www.rrweb.io/
Other
9 stars 5 forks source link

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

Open gestureleft opened 7 months ago

gestureleft commented 7 months ago

Preflight Checklist

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

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.