GHSA-Q4XF-287F-98R8
Stored XSS via unescaped lineAnchors code block option
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-Q4XF-287F-98R8 divulgada | |
| Remediación | Parche v0.166.0 | github.com/gohugoio/hugo · 0 d desde divulgación | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Impact
Hugo's syntax highlighter did not escape the `lineAnchors` option before passing it to Chroma, which writes the value verbatim into the `id` and `href` attributes of the generated line number markup. A `lineAnchors` value supplied as a code fence attribute in Markdown content, e.g.
```go {lineNos=true anchorLineNos=true lineAnchors="z\"><script>alert(1)</script>"}
func main() {}````
resulted in unescaped HTML in the rendered page. This is a stored cross-site scripting (XSS) vulnerability for sites that build and publish Markdown from untrusted contributors.
The `highlight` template function is affected in the same way when given an untrusted `lineAnchors` option.
Patches
Fixed in v0.166.0. The `lineAnchors` value is now HTML-escaped before it is passed to Chroma.
Workarounds
None. If you cannot upgrade, do not build Markdown from untrusted sources.
References
Note that per Hugo's security model https://gohugo.io/about/security/, content is considered trusted input. This advisory is published for sites that nonetheless process untrusted Markdown.
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
gogithub.com/gohugoio/hugo |
Corregida | v0.166.0 | 0 d | v0.170.0 no afectada |
0.166.0v0.166.0Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/gohugoio/hugo/security/advisories/GHSA-q4xf-287f-98r8Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
