Commit 8efcdbf
fix: sanitize dangerouslySetInnerHTML with DOMPurify to prevent XSS (#33)
Add DOMPurify sanitization to the ANSI log renderer in no-code-model.
The parseLog function converts ANSI escape codes to HTML via
ansi-to-html, then renders with dangerouslySetInnerHTML. Without
sanitization, malicious content in logs could execute scripts.
- Install dompurify dependency
- Wrap ansiToHtml.toHtml() output with DOMPurify.sanitize()
- Only instance of dangerouslySetInnerHTML in the entire frontend
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 5d912de commit 8efcdbf
File tree
3 files changed
+14
-35
lines changed- frontend
- src/ide/editor/no-code-model
3 files changed
+14
-35
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
358 | 359 | | |
359 | 360 | | |
360 | 361 | | |
361 | | - | |
| 362 | + | |
362 | 363 | | |
363 | 364 | | |
364 | 365 | | |
| |||
0 commit comments