DioxusLabs / DioxusLabs/dioxus

CLI: Add CSP to output `index.html` to prevent XSS attacks

Open
#1,484 0 comments 2 reactions 0 assignees View on GitHub
enhancement security
Dominant language
Rust
Stars
39.1k
Forks
1.9k
Avg merge
4d 10h
Merged PRs (30d)
4

Description

## Specific Demand

The CLI knows all the scripts that are loaded into the app. That is, the app itself and scripts included in `Dioxus.toml`. We can generate a SHA256/384/512 from them, and include that in the CSP.

## Implement Suggestion

This works for me (I tested this on a bundled build, so it's just one JS file and one SHA):
```html

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.