I am facing an issue where a third-party JavaScript file is being loaded into my application, which then injects an iframe onto the page. This iframe subsequently loads its own JavaScript that creates an inline style tag in the parent window.
Due to this sequence of events, I find myself needing to include "unsafe-inline" in my content security policy for the style-src directive. Is there a solution similar to "strict-dynamic" that could handle styles loaded in this manner? Or perhaps another way to allow this specific stylesheet without having to include "unsafe-inline" in my CSP?
The best idea I have at the moment is to periodically scan this redirected file and generate subresource integrity hashes for it to add to my CSP on a regular basis. However, I worry that this approach may be too delicate.