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

[feat] Allow limiting dangerousDisableAssetCspModification to "script" or "style" #3831

Closed
MaKleSoft opened this issue Mar 31, 2022 · 3 comments

Comments

@MaKleSoft
Copy link

MaKleSoft commented Mar 31, 2022

Describe the problem

The dangerousDisableAssetCspModification is great for us because we've found that injecting nonces for style sheets didn't play well with the UI library we were using (lit). But it would be even better if there was an option to disable nonces for style and script tags individually! In our case, we'd like to disable the feature for style tags (since it breaks our app) but keep it for script tags (which are the more dangerous attack surface anyway).

Describe the solution you'd like

In addition to boolean values, also allow "script" | "style". For example, the following would disable nonces for style sheets only:

{
    ...
    "security": {
        "csp": "...",
        "dangerousDisableAssetCspModification": "style"
     }
}

Alternatives considered

No response

Additional context

No response

@JonasKruckenberg
Copy link
Contributor

I like this idea, but I have one note: This specific config api only works with these 3 possible values: boolean | "script" | "style" since each are mutually exclusive. This is not a problem right now, but we should thin about other resource types in the future? Do we see Tauri injecting nonces for images in the future? Videos? Wasm?

@lucasfernog
Copy link
Member

We need to consider future changes so using an array makes more sense here.

@MaKleSoft
Copy link
Author

Yep, boolean | string[] would work as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants