Commit ae39d75
authored
feat: Enhance CSP in
- **Changes**:
- Refined the `CspHtmlWebpackPlugin` configuration:
- Added `base-uri` directive with `'self'`.
- Updated `script-src` to include `'strict-dynamic'` and `'unsafe-inline'` for better compatibility with dynamic scripts.
- Enabled `'unsafe-inline'` for `style-src` to accommodate inline styles.
- Explicitly disabled `object-src` with `'none'`.
- Added `require-trusted-types-for` to enforce Trusted Types for scripts.
- Commented out `StrictCspHtmlWebpackPlugin` for potential future use with `enableTrustedTypes`.
- **Purpose**:
- Strengthen security by enhancing Content Security Policy (CSP) directives.
- **Impact**:
- Reduces vulnerabilities to XSS and related attacks while allowing necessary script and style flexibility.webpack.config.js for stricter security policies (#78)1 parent 8473e9b commit ae39d75
1 file changed
+11
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
213 | 216 | | |
214 | 217 | | |
215 | 218 | | |
| |||
0 commit comments