{"id":"CVE-2026-50135","aliases":["CVE-2026-50135","GHSA-fw87-fv5r-9fpw","GO-2026-5380"],"related":[],"kind":"vulnerability","state":"published","title":"Hugo: Symlink confinement bypass in resources.Get","summary":"Hugo is a static site generator. From 0.123.0 to 0.161.1, a regression made  RootMappingFs.statRoot  use  Stat  (follows symlinks) instead of  Lstat , so a direct  resources.Get  of a symlink pointing outside its mount returned the target's contents — letting a symlink planted in a local mount (e.g. a vendored  themes/  theme) read arbitrary files accessible to the Hugo user. Go-module themes from GitHub (symlinks stripped) and directory walks were unaffected. Fixed in 0.162.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Hugo is a static site generator. From 0.123.0 to 0.161.1, a regression made  RootMappingFs.statRoot  use  Stat  (follows symlinks) instead of  Lstat , so a direct  resources.Get  of a symlink pointing outside its mount returned the target's contents — letting a symlink planted in a local mount (e.g. a vendored  themes/  theme) read arbitrary files accessible to the Hugo user. Go-module themes from GitHub (symlinks stripped) and directory walks were unaffected. Fixed in 0.162.0.","source":"cvelist"},{"lang":"en","text":"**Commit:** [f8b5fa09a6](https://github.com/gohugoio/hugo/commit/f8b5fa09a6) — _Fix prevention of direct symlink reads in resources.Get_\n**Affected versions:** v0.123.0 through v0.161.1. Earlier versions are not affected.\n**Fixed in:** v0.162.0.\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 `resources.Get \"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`.\n\n**Mitigation.** v0.162.0 calls `LstatIfPossible` and rejects symlinked entries with `os.ErrNotExist`, matching the behaviour of pre-v0.123.0 releases and of the directory-walking code paths.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Hugo: Symlink confinement bypass in resources.Get in github.com/gohugoio/hugo","format":"markdown","source":"go"},{"lang":"es","text":"Hugo es un generador de sitios estáticos. Desde la versión 0.123.0 hasta la 0.161.1, una regresión hizo que RootMappingFs.statRoot usara Stat (sigue enlaces simbólicos) en lugar de Lstat, por lo que un resources.Get directo de un enlace simbólico que apuntaba fuera de su punto de montaje devolvía el contenido del destino - permitiendo que un enlace simbólico plantado en un punto de montaje local (por ejemplo, un tema ’themes/’ suministrado) leyera archivos arbitrarios accesibles para el usuario de Hugo. Los temas de módulos Go de GitHub (con los enlaces simbólicos eliminados) y los recorridos de directorios no se vieron afectados. Corregido en la versión 0.162.0.","source":"nvd"}],"published":"2026-06-16T20:12:34.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:N/PR:N/UI:A/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","score":6.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","score":6.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N","score":5.5,"rating":"MEDIUM"}],"cwes":["CWE-59"],"affected":[{"ranges":[{"version":">= 0.123.0, < 0.162.0","status":"affected"}],"vendor":"gohugoio","product":"hugo","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.123.0","status":"affected","fixed":"0.162.0"}],"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.162.0"}],"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.161.1"}],"vendor":"gohugo","product":"hugo","cpe":"cpe:2.3:a:gohugo:hugo:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/gohugoio/hugo/security/advisories/GHSA-fw87-fv5r-9fpw","tags":["advisory","patch","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/gohugoio/hugo/commit/f8b5fa09a64950c32b803821ede411ebfe772b7a","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/gohugoio/hugo/releases/tag/v0.162.0","tags":["product","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","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-07T16:52:31.351Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-50135","url":"https://www.cve.org/CVERecord?id=CVE-2026-50135","licence":"CVE Terms of Use","modified":"2026-07-07T16:57:29.874Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-fw87-fv5r-9fpw","url":"https://github.com/advisories/GHSA-fw87-fv5r-9fpw","licence":"CC-BY-4.0","modified":"2026-07-07T20:41:13.656Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5380","url":"https://pkg.go.dev/vuln/GO-2026-5380","licence":"CC-BY-4.0","modified":"2026-07-07T20:30:13.601Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-50135","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-50135","licence":"Public domain","modified":"2026-10-25T20:10:00.147Z"}],"updatedAt":"2026-11-25T22:59:27.257Z","epss":{"score":0.00271,"percentile":0.20715,"date":"2026-12-01T12:00:22.000Z"}}