{"id":"CVE-2026-58403","aliases":["CVE-2026-58403","GHSA-c3wq-j5vh-68rc","GO-2026-5309"],"related":[],"kind":"vulnerability","state":"published","title":"Hugo symlink confinement bypass in os.ReadFile","summary":"Hugo is a static site generator. From v0.123.0 through v0.163.0, Hugo's virtual filesystem is designed so that files under a mount cannot reach outside the mount tree, but a regression caused RootMappingFs.statRoot to call Stat, which follows symlinks, instead of Lstat, so a direct os.ReadFile \"somefile\" where somefile was a symlink pointing outside the mount would return the target's contents. This effectively let a symlink planted inside a theme or local mount read arbitrary files reachable to the user running hugo. This issue is fixed in v0.163.1.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Hugo is a static site generator. From v0.123.0 through v0.163.0, Hugo's virtual filesystem is designed so that files under a mount cannot reach outside the mount tree, but a regression caused RootMappingFs.statRoot to call Stat, which follows symlinks, instead of Lstat, so a direct os.ReadFile \"somefile\" where somefile was a symlink pointing outside the mount would return the target's contents. This effectively let a symlink planted inside a theme or local mount read arbitrary files reachable to the user running hugo. This issue is fixed in v0.163.1.","source":"cvelist"},{"lang":"en","text":"**Affected versions:** v0.123.0 through v0.163.0. Earlier versions are not affected.\n**Fixed in:** v0.163.1.\n**Severity:** Medium. Requires the attacker to be able to place (or convince a site author to place) a symlink inside a mounted directory — for example, inside a locally-vendored theme under `themes/`. Themes mounted as Go modules from GitHub have symlinks stripped on download and are not affected. Multi-directory walks (e.g. content/asset walking) were not affected either; only direct lookups via `resources.Get` followed symlinks.\n\n**Description.** Hugo's virtual filesystem is designed so that files under a mount cannot reach outside the mount tree. A regression introduced in v0.123.0 caused `RootMappingFs.statRoot` to call `Stat` (which follows symlinks) instead of `Lstat`, so a direct `os.ReadFile \"somefile\"` where `somefile` was a symlink pointing outside the mount would return the target's contents. This effectively let a symlink planted inside a theme or local mount read arbitrary files reachable to the user running `hugo`.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Hugo: Symlink confinement bypass in os.ReadFile in github.com/gohugoio/hugo","format":"markdown","source":"go"},{"lang":"es","text":"Hugo es un generador de sitios estáticos. Desde la v0.123.0 hasta la v0.163.0, el sistema de archivos virtual de Hugo está diseñado para que los archivos bajo un montaje no puedan acceder fuera del árbol de montaje, pero una regresión hizo que RootMappingFs.statRoot llamara a Stat, que sigue los enlaces simbólicos, en lugar de Lstat, de modo que una llamada directa a os.ReadFile ’somefile’ donde somefile era un enlace simbólico que apuntaba fuera del montaje devolvería el contenido del objetivo. Esto permitió efectivamente que un enlace simbólico plantado dentro de un tema o montaje local leyera archivos arbitrarios accesibles para el usuario que ejecuta hugo. Este problema está corregido en la v0.163.1.","source":"nvd"}],"published":"2026-06-19T17:45:38.000Z","modified":"2026-10-25T20:10:00.147Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","score":5.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","score":5.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:N/SC:H/SI:N/SA:N","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-59"],"affected":[{"ranges":[{"version":">= 0.123.0, < 0.163.1","status":"affected"}],"vendor":"gohugoio","product":"hugo","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.123.0","status":"affected","fixed":"0.163.1"}],"ecosystem":"Go","package":"github.com/gohugoio/hugo","purl":"pkg:golang/github.com/gohugoio/hugo","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.123.0","status":"affected","fixed":"0.163.1"}],"ecosystem":"Go","package":"github.com/gohugoio/hugo","purl":"pkg:golang/github.com/gohugoio/hugo","source":"go"},{"ranges":[{"status":"affected","introduced":"0.123.0","fixed":"0.163.1"}],"vendor":"gohugo","product":"hugo","cpe":"cpe:2.3:a:gohugo:hugo:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/gohugoio/hugo/security/advisories/GHSA-c3wq-j5vh-68rc","tags":["advisory","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/gohugoio/hugo/pull/15020","tags":["issue-tracking","x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/gohugoio/hugo/commit/cf9c8f93ca2a2838ce378f9e36d052ac2f79e229","tags":["patch","x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/gohugoio/hugo/releases/tag/v0.163.1","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","go","nvd"]},{"url":"https://github.com/gohugoio/hugo","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-07-06T20:51:16.911Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-58403","url":"https://www.cve.org/CVERecord?id=CVE-2026-58403","licence":"CVE Terms of Use","modified":"2026-07-06T20:51:27.624Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-c3wq-j5vh-68rc","url":"https://github.com/advisories/GHSA-c3wq-j5vh-68rc","licence":"CC-BY-4.0","modified":"2026-07-24T19:11:41.347Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5309","url":"https://pkg.go.dev/vuln/GO-2026-5309","licence":"CC-BY-4.0","modified":"2026-07-24T19:11:41.347Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-58403","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-58403","licence":"Public domain","modified":"2026-10-25T20:10:00.147Z"}],"updatedAt":"2026-11-25T22:59:27.245Z","epss":{"score":0.00318,"percentile":0.26688,"date":"2026-12-02T12:00:21.000Z"}}