Commit fd320fe
fix(rss): block stored XSS via tag names and raw-HTML markdown
GenerateRSS embeds two attacker-controlled surfaces into Atom
<summary type="html">: tag names interpolated with %s and markdown
content rendered with raw HTML passthrough enabled. RSS readers that
honour type="html" decode the XML entities and execute any <script>
that lands inside, giving an admin (or any future tag write path)
stored XSS against every subscriber.
- mdUtil.MdToHTML: enable html.SkipHTML so raw <script>/<iframe> in
echo bodies are dropped. RSS is the only caller; the SPA renders
markdown client-side via markdown-it/Vditor and is unaffected.
- common.GenerateRSS: html-escape tag.Name before interpolation.
- echo.ProcessEchoTags / CreateTag: reject tag names containing
<>"'& as defence in depth so the payload never reaches the DB.
Reported as GHSA-3v85-fqvh-7rxf.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent cb8d7a9 commit fd320fe
3 files changed
Lines changed: 51 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
123 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
124 | 131 | | |
125 | 132 | | |
126 | 133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
271 | 294 | | |
272 | 295 | | |
273 | 296 | | |
| |||
322 | 345 | | |
323 | 346 | | |
324 | 347 | | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
325 | 351 | | |
326 | 352 | | |
327 | 353 | | |
| |||
363 | 389 | | |
364 | 390 | | |
365 | 391 | | |
366 | | - | |
367 | | - | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
368 | 397 | | |
| 398 | + | |
369 | 399 | | |
370 | 400 | | |
371 | 401 | | |
| |||
451 | 481 | | |
452 | 482 | | |
453 | 483 | | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
454 | 490 | | |
455 | 491 | | |
456 | 492 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
32 | | - | |
| 35 | + | |
| 36 | + | |
33 | 37 | | |
34 | 38 | | |
35 | 39 | | |
| |||
0 commit comments