Repository navigation
Commit 945ae9a
Sanitize comment markdown on the ReScript page (#877)
Comments on /rescript rendered marked output directly, so HTML in a
comment could run script in another visitor's browser. The React and
server component views already sanitize.
Pass the output through sanitize-html with the same defaults as
Comment.jsx, and add a system spec that fails without the fix.
Security: this closes a stored XSS on /rescript. Stored comments are
unchanged; they are sanitized when displayed.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>1 parent af62fed commit 945ae9a
3 files changed
Lines changed: 19 additions & 1 deletion
File tree
- client/app/bundles/comments/rescript
- CommentList/Comment
- bindings
- spec/rescript
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
32 | 48 | | |
33 | 49 | | |
34 | 50 | | |
| |||
0 commit comments