{"id":"CVE-2026-140394","aliases":["DEBIAN-CVE-2026-140394","EUVD-2026-140249","GHSA-332r-53xh-x52j","GHSA-4whp-jx7j-xvrm","RHSA-2026:104146","UBUNTU-CVE-2026-140394"],"status":"published","title":"Hugo 0.140.2 before 0.170.0 Stored XSS via highlight shortcode wrapperClass","description":"Hugo after 0.140.2 and before 0.170.0 contains a stored cross-site scripting vulnerability in the highlight shortcode and transform.Highlight template function, which write the wrapperClass option unescaped into the wrapping div's class attribute. Content authors can supply a wrapperClass value that closes the attribute and appends a script element, executing JavaScript in visitors' browsers under the site's origin.","severity":{"version":"4.0","score":5.1,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","level":"medium","assessor":"cna","from":"cve","others":[{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","level":"medium","assessor":"cna","from":"cve"},{"version":"4.0","score":5.1,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","level":"medium","from":"ghsa"},{"version":"4.0","score":4.6,"vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N","level":"medium","from":"ghsa"}]},"epss":{"day":"2026-12-04","score":0.00415,"percentile":0.37839,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true,"poc_reported":true},"cwes":["CWE-79"],"published":"2026-12-01T02:24:46Z","modified":"2026-12-03T20:48:21Z","fixes":[{"ecosystem":"Go","package":"github.com/gohugoio/hugo","fixed_in":["0.170.0"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"Go","package":"github.com/gohugoio/hugo","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.140.2"},{"fixed":"0.170.0"}]}]},{"source":"osv","ecosystem":"Debian:14","package":"hugo","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.131.0-1","0.131.0-2","0.150.0-1","0.150.1-1","0.151.0-1","0.151.1-1","0.151.2-1","0.152.1-1","0.152.2-1","0.153.0-1","0.153.1-1","0.153.1-2","0.153.1-3","0.153.2-1","0.154.1-1","0.154.2-1","0.154.2-2","0.154.3-1","0.154.5-1","0.155.1-1","0.155.2-1","0.155.3-1","0.157.0-1","0.157.0-2","0.157.0-3","0.158.0-1","0.158.0-2","0.158.0-3","0.159.0-1","0.159.1-1","0.159.2-1","0.160.0-1","0.160.0-2","0.160.1-1","0.161.0-1","0.161.1-1","0.162.1-1","0.162.1-2","0.162.1-3","0.162.1-4","0.162.1-5","0.162.1-6","0.162.1-7","0.165.0-1","0.165.0-2","0.165.0-3","0.166.0-1","0.166.0-2","0.167.0-1","0.167.0-2","0.167.0-3","0.167.0-4","0.167.0-5","0.167.0-6","0.167.0-7","0.168.0-1","0.168.0-2","0.168.0-3","0.169.0-1","0.169.0-2","0.170.1-1","0.170.1-2"]},{"source":"osv","ecosystem":"Go","package":"github.com/gohugoio/hugo","ranges":[{"type":"SEMVER","events":[{"introduced":"0.140.2"},{"fixed":"0.170.0"}]}]},{"source":"osv","ecosystem":"Red Hat:hummingbird:1","package":"hugo","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0:0.170.1-0.1.hum1"}]}],"bundled":2},{"source":"osv","ecosystem":"Ubuntu:16.04:LTS","package":"hugo","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.15+git20160109.147.dd1d655-1","0.15+git20160109.147.dd1d655-2","0.15+git20160128.179.5def6d9-1","0.15+git20160206.203.ed23711-1"]},{"source":"osv","ecosystem":"Ubuntu:18.04:LTS","package":"hugo","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.25.1-2","0.26-1","0.35-1","0.37.1-1","0.38-1","0.39-1","0.40-1","0.40.1-1"]},{"source":"osv","ecosystem":"Ubuntu:20.04:LTS","package":"hugo","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.57.2-1","0.58.3-1","0.59.1-1.1","0.68.3-1"]},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"hugo","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.80.0-6","0.89.4-2","0.90.0-1","0.90.1-1","0.91.0-1","0.91.2-1","0.92.0-1","0.92.1-1build1","0.92.2-1","0.92.2-1ubuntu0.1"]},{"source":"osv","ecosystem":"Ubuntu:Pro:24.04:LTS","package":"hugo","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.113.0-3","0.119.0-2","0.120.3-1","0.120.4-1","0.121.2-1","0.122.0-1","0.123.7-1build1","0.123.7-1ubuntu0.1","0.123.7-1ubuntu0.2","0.123.7-1ubuntu0.2+esm1","0.123.7-1ubuntu0.3","0.123.7-1ubuntu0.3+esm1","0.123.7-1ubuntu0.3+esm2"]},{"source":"osv","ecosystem":"Ubuntu:26.10","package":"hugo","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.154.5-1","0.162.1-5","0.162.1-7"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"hugo","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.131.0-1","0.152.2-1","0.153.1-3","0.153.2-1","0.154.2-2","0.154.3-1","0.154.5-1"]}],"products":[{"vendor":"gohugoio","product":"hugo"}],"references":[{"url":"https://github.com/gohugoio/hugo/security/advisories/GHSA-4whp-jx7j-xvrm","tags":["vendor-advisory","exploit","advisory","web","article","report"]},{"url":"https://www.vulncheck.com/advisories/hugo-0.140.2-before-0.170.0-stored-xss-via-highlight-shortcode-wrapperclass","tags":["third-party-advisory","advisory","article"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-140394","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-332r-53xh-x52j"},{"url":"https://github.com/gohugoio/hugo/pull/15564","tags":["web"]},{"url":"https://github.com/gohugoio/hugo/commit/bdde5aa5155c6c349a743e71dc846bef754b6773","tags":["web"]},{"url":"https://github.com/gohugoio/hugo/releases/tag/v0.170.0","tags":["web"]},{"url":"https://github.com/advisories/GHSA-4whp-jx7j-xvrm"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/140xxx/CVE-2026-140394.json","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2026-140394","tags":["advisory"]},{"url":"https://github.com/gohugoio/hugo","tags":["package"]},{"url":"https://access.redhat.com/errata/RHSA-2026:104146","tags":["advisory"]},{"url":"https://images.redhat.com/","tags":["article"]},{"url":"https://access.redhat.com/security/cve/CVE-2026-140395","tags":["report"]},{"url":"https://access.redhat.com/security/updates/classification/","tags":["article"]},{"url":"https://access.redhat.com/security/cve/CVE-2026-140394","tags":["report"]},{"url":"https://security.access.redhat.com/data/csaf/v2/advisories/2026/rhsa-2026_104146.json","tags":["advisory"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2587938","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-140394","tags":["advisory","report"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2587951","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-140395","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-140395","tags":["advisory"]},{"url":"https://github.com/gohugoio/hugo/security/advisories/GHSA-r48v-r4vw-h9v8","tags":["article"]},{"url":"https://www.vulncheck.com/advisories/hugo-0.56.0-before-0.170.0-path-traversal-via-vendor-modules-txt","tags":["article"]},{"url":"https://ubuntu.com/security/CVE-2026-140394","tags":["report"]}],"sources":{"cve":[{"id":"CVE-2026-140394","title":"Hugo 0.140.2 before 0.170.0 Stored XSS via highlight shortcode wrapperClass","description":"Hugo after 0.140.2 and before 0.170.0 contains a stored cross-site scripting vulnerability in the highlight shortcode and transform.Highlight template function, which write the wrapperClass option unescaped into the wrapping div's class attribute. Content authors can supply a wrapperClass value that closes the attribute and appends a script element, executing JavaScript in visitors' browsers under the site's origin.","status":"published","published":"2026-12-01T14:29:12.12Z","modified":"2026-12-01T15:41:04.629Z","cvss":[{"version":"4.0","score":5.1,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","level":"medium","assessor":"cna"},{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","level":"medium","assessor":"cna"}],"cwes":["CWE-79"],"ssvc":{"exploitation":"poc","automatable":"no","technical_impact":"partial","date":"2026-12-01"},"updated_at":"2026-12-01T15:48:16.836784Z"}],"euvd":[{"id":"EUVD-2026-140249","description":"Hugo after 0.140.2 and before 0.170.0 contains a stored cross-site scripting vulnerability in the highlight shortcode and transform.Highlight template function, which write the wrapperClass option unescaped into the wrapping div's class attribute. Content authors can supply a wrapperClass value that closes the attribute and appends a script element, executing JavaScript in visitors' browsers under the site's origin.","status":"published","published":"2026-12-01T14:29:12Z","modified":"2026-12-01T15:41:04Z","cvss":[{"version":"4.0","score":5.1,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","level":"medium"}],"updated_at":"2026-12-01T18:19:42.299783Z"}],"ghsa":[{"id":"GHSA-332r-53xh-x52j","title":"Hugo after 0.140.2 and before 0.170.0 contains a stored cross-site scripting vulnerability in the...","description":"Hugo after 0.140.2 and before 0.170.0 contains a stored cross-site scripting vulnerability in the highlight shortcode and transform.Highlight template function, which write the wrapperClass option unescaped into the wrapping div's class attribute. Content authors can supply a wrapperClass value that closes the attribute and appends a script element, executing JavaScript in visitors' browsers under the site's origin.","status":"published","published":"2026-12-01T15:31:23Z","modified":"2026-12-01T15:31:32Z","cvss":[{"version":"4.0","score":5.1,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","level":"medium"},{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"cwes":["CWE-79"],"updated_at":"2026-12-01T15:59:29.139298Z"},{"id":"GHSA-4whp-jx7j-xvrm","title":"Hugo highlight wrapperClass option allows stored cross-site scripting","description":"### Summary\n\nThe `wrapperClass` option of the built-in `highlight` shortcode (and the `transform.Highlight` template function) was written unescaped into the wrapping `\u003cdiv class=\"...\"\u003e`, allowing a content author to inject arbitrary HTML/JavaScript into the rendered page.\n\n### Details\n\n`markup/highlight/highlight.go` (`writeDivStart`) wrote `wrapperClass` directly between `class=\"` and `\"`, while all other attribute values were HTML-escaped. Because the shortcode's options string is decoded into the highlight config, any content author can set `wrapperClass`. The Goldmark `unsafe` setting does not apply, as the value never passes through the Markdown HTML renderer. Markdown code fences are not affected.\n\nFixed by HTML-escaping the value.\n\n### Proof of concept\n\nA content author on a multi-author site adds a `highlight` shortcode to a page with a `wrapperClass` option value that closes the `class` attribute and appends a `\u003cscript\u003e` element. When the site is built, the script ends up in the page body and runs in visitors' browsers under the site's origin.\n\n### Impact\n\nStored XSS for sites that render content from less-trusted authors. The `highlight` shortcode is built in and enabled by default.","status":"published","published":"2026-12-01T02:24:46Z","modified":"2026-12-01T02:24:46Z","cvss":[{"version":"4.0","score":4.6,"vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N","level":"medium"}],"cwes":["CWE-79"],"updated_at":"2026-12-01T02:25:18.80066Z"}],"nvd":[{"id":"CVE-2026-140394","description":"Hugo after 0.140.2 and before 0.170.0 contains a stored cross-site scripting vulnerability in the highlight shortcode and transform.Highlight template function, which write the wrapperClass option unescaped into the wrapping div's class attribute. Content authors can supply a wrapperClass value that closes the attribute and appends a script element, executing JavaScript in visitors' browsers under the site's origin.","status":"published","published":"2026-12-01T15:18:04.59Z","modified":"2026-12-01T16:18:19.697Z","cvss":[{"version":"4.0","score":5.1,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","level":"medium","assessor":"secondary"},{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","level":"medium","assessor":"secondary"}],"cwes":["CWE-79"],"ssvc":{"exploitation":"poc","automatable":"no","technical_impact":"partial","date":"2026-12-01"},"updated_at":"2026-12-01T16:21:11.956854Z"}],"osv":[{"id":"CVE-2026-140394","title":"Hugo 0.140.2 before 0.170.0 Stored XSS via highlight shortcode wrapperClass","description":"Hugo after 0.140.2 and before 0.170.0 contains a stored cross-site scripting vulnerability in the highlight shortcode and transform.Highlight template function, which write the wrapperClass option unescaped into the wrapping div's class attribute. Content authors can supply a wrapperClass value that closes the attribute and appends a script element, executing JavaScript in visitors' browsers under the site's origin.","status":"published","published":"2026-12-01T14:29:12.12Z","modified":"2026-12-02T20:46:03.865623154Z","cvss":[{"version":"4.0","score":5.1,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","level":"medium"}],"cwes":["CWE-79"],"updated_at":"2026-12-01T16:31:21.240613Z"},{"id":"DEBIAN-CVE-2026-140394","upstream":["CVE-2026-140394"],"description":"Hugo after 0.140.2 and before 0.170.0 contains a stored cross-site scripting vulnerability in the highlight shortcode and transform.Highlight template function, which write the wrapperClass option unescaped into the wrapping div's class attribute. Content authors can supply a wrapperClass value that closes the attribute and appends a script element, executing JavaScript in visitors' browsers under the site's origin.","status":"published","published":"2026-12-01T15:18:04.59Z","modified":"2026-12-02T16:00:06.019364285Z","cvss":[{"version":"4.0","score":5.1,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","level":"medium"}],"updated_at":"2026-12-02T16:19:31.134606Z"},{"id":"GHSA-4whp-jx7j-xvrm","title":"Hugo highlight wrapperClass option allows stored cross-site scripting","description":"### Summary\n\nThe `wrapperClass` option of the built-in `highlight` shortcode (and the `transform.Highlight` template function) was written unescaped into the wrapping `\u003cdiv class=\"...\"\u003e`, allowing a content author to inject arbitrary HTML/JavaScript into the rendered page.\n\n### Details\n\n`markup/highlight/highlight.go` (`writeDivStart`) wrote `wrapperClass` directly between `class=\"` and `\"`, while all other attribute values were HTML-escaped. Because the shortcode's options string is decoded into the highlight config, any content author can set `wrapperClass`. The Goldmark `unsafe` setting does not apply, as the value never passes through the Markdown HTML renderer. Markdown code fences are not affected.\n\nFixed by HTML-escaping the value.\n\n### Proof of concept\n\nA content author on a multi-author site adds a `highlight` shortcode to a page with a `wrapperClass` option value that closes the `class` attribute and appends a `\u003cscript\u003e` element. When the site is built, the script ends up in the page body and runs in visitors' browsers under the site's origin.\n\n### Impact\n\nStored XSS for sites that render content from less-trusted authors. The `highlight` shortcode is built in and enabled by default.","status":"published","published":"2026-12-01T02:24:46Z","modified":"2026-12-01T16:11:12.093005942Z","cvss":[{"version":"4.0","score":4.6,"vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N","level":"medium"}],"cwes":["CWE-79"],"updated_at":"2026-12-01T16:31:21.240613Z"},{"id":"RHSA-2026:104146","upstream":["CVE-2026-140394","CVE-2026-140395"],"title":"Red Hat Security Advisory: Red Hat Hardened Images RPMs bug fix and enhancement update","status":"published","published":"2026-12-02T10:04:34Z","modified":"2026-12-02T22:32:45Z","cvss":[{"version":"3.1","score":5.5,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N","level":"medium"}],"updated_at":"2026-12-02T10:35:12.984201Z"},{"id":"UBUNTU-CVE-2026-140394","upstream":["CVE-2026-140394"],"description":"(Hugo after 0.140.2 and before 0.170.0 contains a stored cross-site scr ...)","status":"published","published":"2026-12-03T00:00:00Z","modified":"2026-12-03T20:48:21.246361713Z","updated_at":"2026-12-03T21:13:04.052985Z"}]}}
