Skip to content

Cannot load scripts in iframe due to Content Security Policy #6

Description

@deatondg

My particular use case requires running a user script inside an iframe on my iPad. Unfortunately, it is not a publicly accessible domain, so I cannot share it here.

Attempting to inject my script fails with
[Error] Refused to execute a script because its hash, its nonce, or 'unsafe-inline' appears in neither the script-src directive nor the default-src directive of the Content Security Policy. (auth, line 33)
once the iframe is included, but I am able to see the script present in the HTML for the iframe.

It seems to me that since this proxy is able to arbitrarily modify the presented HTML, it would be possible to compute the hash of our injected script and add it to the CSP before presenting the page, thus avoiding this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions