{"id":"CVE-2026-10618","aliases":["CVE-2026-10618"],"related":[],"kind":"vulnerability","state":"published","title":"Hugo 0.93.0 through 0.165.0 Stored Cross-Site Scripting via Unescaped Code-Fence Attribute Values","summary":"Hugo's default fenced-code-block renderer writes attribute values taken from the code-fence info string into the rendered HTML without escaping them. New in markup/internal/attributes/attributes.go converts every attribute value from a byte slice to a string as it is stored, deliberately dropping the escaping that used to happen there, and RenderAttributes in the same file escapes only values that are still byte slices, so its escaping branch is never reached and every value is written verbatim. The function's documentation states that it performs HTML escaping of string attributes, which it does not. A quote inside an attribute value in the info string therefore terminates the attribute and allows a further attribute, including an event handler, to be placed on the wrapper element, and the script runs for every visitor who loads the page. This path is reached under the default configuration, with code fences enabled and without goldmark's unsafe setting or any custom render hook. Attribute names beginning with on are filtered when the attributes are parsed, so injection is achieved through the value rather than the name.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Hugo's default fenced-code-block renderer writes attribute values taken from the code-fence info string into the rendered HTML without escaping them. New in markup/internal/attributes/attributes.go converts every attribute value from a byte slice to a string as it is stored, deliberately dropping the escaping that used to happen there, and RenderAttributes in the same file escapes only values that are still byte slices, so its escaping branch is never reached and every value is written verbatim. The function's documentation states that it performs HTML escaping of string attributes, which it does not. A quote inside an attribute value in the info string therefore terminates the attribute and allows a further attribute, including an event handler, to be placed on the wrapper element, and the script runs for every visitor who loads the page. This path is reached under the default configuration, with code fences enabled and without goldmark's unsafe setting or any custom render hook. Attribute names beginning with on are filtered when the attributes are parsed, so injection is achieved through the value rather than the name.","source":"cvelist"},{"lang":"es","text":"El renderizador predeterminado de bloques de código vallados de Hugo escribe los valores de atributos tomados de la cadena de información de la valla de código en el HTML renderizado sin escaparlos. Lo nuevo en markup/internal/attributes/attributes.go convierte cada valor de atributo de un segmento de bytes a una cadena a medida que se almacena, eliminando deliberadamente el escape que solía ocurrir allí, y RenderAttributes en el mismo archivo escapa solo los valores que aún son segmentos de bytes, por lo que su rama de escape nunca se alcanza y cada valor se escribe textualmente. La documentación de la función establece que realiza el escape HTML de los atributos de cadena, lo cual no hace. Una comilla dentro de un valor de atributo en la cadena de información, por lo tanto, termina el atributo y permite que un atributo adicional, incluyendo un gestor de eventos, se coloque en el elemento contenedor, y el script se ejecuta para cada visitante que carga la página. Esta ruta se alcanza bajo la configuración predeterminada, con las vallas de código habilitadas y sin la configuración unsafe de goldmark ni ningún render hook personalizado. Los nombres de atributos que comienzan con on se filtran cuando se analizan los atributos, por lo que la inyección se logra a través del valor en lugar del nombre.","source":"nvd"}],"published":"2026-08-24T10:29:10.191Z","modified":"2026-10-12T15:10:00.207Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:A/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N","score":4.8,"rating":"MEDIUM"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:A/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N","score":4.8,"rating":"MEDIUM"},{"scorer":"VulnCheck","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"type":"semver","introduced":"0.93.0","lastAffected":"0.165.0","status":"affected"}],"vendor":"gohugoio","product":"hugo","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"0.93.0","fixed":"0.165.0"}],"vendor":"gohugo","product":"hugo","cpe":"cpe:2.3:a:gohugo:hugo:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/gohugoio/hugo","tags":["product"],"sources":["cvelist","nvd"]},{"url":"https://github.com/gohugoio/hugo/blob/v0.165.0/markup/internal/attributes/attributes.go","tags":["product","technical-description"],"sources":["cvelist","nvd"]},{"url":"https://github.com/gohugoio/hugo/blob/v0.165.0/markup/goldmark/codeblocks/render.go","tags":["product","technical-description"],"sources":["cvelist","nvd"]},{"url":"https://github.com/gohugoio/hugo/blob/v0.165.0/markup/highlight/highlight.go","tags":["product","technical-description"],"sources":["cvelist","nvd"]},{"url":"https://www.vulncheck.com/advisories/hugo-through-stored-cross-site-scripting-via-unescaped-code-fence-attribute-values","tags":["third-party-advisory"],"sources":["cvelist","nvd"]}],"credits":["Michael Holmquist"],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-08-26T18:20:48.410Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-10618","url":"https://www.cve.org/CVERecord?id=CVE-2026-10618","licence":"CVE Terms of Use","modified":"2026-08-26T18:20:58.149Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-10618","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-10618","licence":"Public domain","modified":"2026-10-12T15:10:00.207Z"}],"updatedAt":"2026-11-25T22:59:34.993Z","epss":{"score":0.00215,"percentile":0.12655,"date":"2026-12-01T12:00:22.000Z"}}