gchq / gchq/CyberChef

Feature request: make CyberChef ready for strict content-security-policy

Open
#1,486 2 comments 3 reactions 0 assignees View on GitHub
feature security
Dominant language
JavaScript
Stars
35.8k
Forks
4.1k
Avg merge
2d 26m
Merged PRs (30d)
33

Description

**Is your feature request related to a problem? Please describe.**
ChyberChes is intended for mangling security related data which potentially contain some malicious stuff. Currently the application contains a lot of inline styles and at least 2 inline scripts, which prevent to serve it with strict security policy inplace. This potentially makes some room to execute some XSS or CSRF code from the input.

**Describe the solution you'd like**
1) add http-equiv to the src/web/html/index.html and add the equivalent of the Content-Security-Policy header.
ideal target would be something like:
```

```
Currently somehow working policy would be
```

```
2) move the static script from src/web/html/index.html to some file location like assets/loader.js

3) change the inline styles to proper style classes to avoid excluding them from a policy using hashes

**Describe alternatives you've considered**
Alternative is setting the .htaccess or similar configuration and using the 'unsafe-hashes', but as hashes would be changing with each version this is quite cumbersome to update.

**Additional context**
This is what happens currently in Chrome browser if you attemtp to use the CyberChef with strict Content-Security-Policy
```

```
![image](https://user-images.githubusercontent.com/723625/206694426-e6529005-6698-4177-8e89-b75a4b7eb468.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.