{"id":"CVE-2026-25891","aliases":["CVE-2026-25891","GHSA-m3c2-496v-cw3v","GO-2026-4540"],"related":[],"kind":"vulnerability","state":"published","title":"Fiber has an Arbitrary File Read in Static Middleware on Windows","summary":"Fiber is an Express inspired web framework written in Go. A Path Traversal (CWE-22) vulnerability in Fiber allows a remote attacker to bypass the static middleware sanitizer and read arbitrary files on the server file system on Windows. This affects Fiber v3 through version 3.0.0. This has been patched in Fiber v3 version 3.1.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Fiber is an Express inspired web framework written in Go. A Path Traversal (CWE-22) vulnerability in Fiber allows a remote attacker to bypass the static middleware sanitizer and read arbitrary files on the server file system on Windows. This affects Fiber v3 through version 3.0.0. This has been patched in Fiber v3 version 3.1.0.","source":"cvelist"},{"lang":"en","text":"### Summary\n\n**Description**\nA Path Traversal (CWE-22) vulnerability in Fiber allows a remote attacker to bypass the static middleware sanitizer and read arbitrary files on the server file system on Windows. This affects Fiber v3 through version 3.0.0. This has been patched in Fiber v3 version 3.1.0.\n \n### Details\nThe vulnerability resides in `middleware/static/static.go` within the `sanitizePath` function. This function attempts to sanitize the requested path by checking for backslashes, decoding the URL, and then cleaning the path.\n\nThe vulnerability stems from two combined issues:\n- The check for backslash characters happens before the URL decoding loop. If an attacker sends a double-encoded backslash, the initial check sees `%255C` and passes. The loop then decodes this into a single backslash.\n- The function uses `path.Clean` to clean the resulting string. `path.Clean` is designed for slash-separated paths  and does not recognize backslashes as directory separators. Consequently, sequences like `..\\..\\` are treated as valid filenames.\n\nWhen this sanitized path is later used, the backslashes are interpreted as valid separators, allowing the attacker to traverse up the directory tree.\n```go\n// pkg/static/static.go\nfunc sanitizePath(p []byte, filesystem fs.FS) ([]byte, error) {\n    ...\n    // this check happens BEFORE decoding\n    if bytes.IndexByte(p, '\\\\') >= 0 {\n        ...\n    } \n    // This loop decodes %255C to %5C to \\\n    for strings.IndexByte(s, '%') >= 0 {\n        us, err := url.PathUnescape(s)\n        ...\n        s = us\n    }\n    // path.Clean only understands forward slashes (/)\n    s = pathpkg.Clean(\"/\" + s)\n    ...\n    return utils.UnsafeBytes(s), nil\n}\n```\n\n### Impact\n\nThis impacts Fiber v3 prereleases through stable release version 3.0.0.\n\nSuccessful exploitation requires the server to be using the static middleware on Windows, as this is the only OS where backslashes are treated as directory separators by the file system.\n\nExploitation allows directory traversal on the host server. An attacker can read arbitrary files within the scope of the application server context. Depending on permissions and deployment conditions, attackers may access sensitive files outside the web root, such as configuration files, source code, or system files. Leaking application secrets often leads to further compromise.\n\n### Patches\n\nThis has been [patched](https://github.com/gofiber/fiber/pull/4064) in Fiber v3 version 3.1.0.  Users are strongly encouraged to update to the latest available release.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Fiber has an Arbitrary File Read in Static Middleware on Windows in github.com/gofiber/fiber/v3","format":"markdown","source":"go"},{"lang":"es","text":"Fiber es un framework web inspirado en Express escrito en Go. Una vulnerabilidad de salto de ruta (CWE-22) en Fiber permite a un atacante remoto eludir el saneador del middleware estático y leer archivos arbitrarios en el sistema de archivos del servidor en Windows. Esto afecta a Fiber v3 hasta la versión 3.0.0. Esto ha sido parcheado en Fiber v3 versión 3.1.0.","source":"nvd"}],"published":"2026-02-24T20:51:01.000Z","modified":"2026-06-17T10:25:23.377Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:P","score":7.7,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:P","score":7.7,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5,"rating":"HIGH"}],"cwes":["CWE-22"],"affected":[{"ranges":[{"version":">= 3.0.0, < 3.1.0","status":"affected"}],"vendor":"gofiber","product":"fiber","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"3.1.0"}],"ecosystem":"Go","package":"github.com/gofiber/fiber/v3","purl":"pkg:golang/github.com/gofiber/fiber/v3","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"3.1.0"}],"ecosystem":"Go","package":"github.com/gofiber/fiber/v3","purl":"pkg:golang/github.com/gofiber/fiber/v3","source":"go"},{"ranges":[{"status":"affected","introduced":"3.0.0","fixed":"3.1.0"}],"vendor":"gofiber","product":"fiber","cpe":"cpe:2.3:a:gofiber:fiber:*:*:*:*:*:go:*:*","source":"nvd"}],"references":[{"url":"https://github.com/gofiber/fiber/security/advisories/GHSA-m3c2-496v-cw3v","tags":["advisory","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/gofiber/fiber/pull/4064","tags":["exploit","fix","issue-tracking","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/gofiber/fiber/commit/59133702301c2ab7b776dd123b474cbd995f2c86","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25891","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/gofiber/fiber","tags":["package"],"sources":["ghsa"]},{"url":"https://pkg.go.dev/vuln/GO-2026-4540","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-02-24T21:39:00.083Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-25891","url":"https://www.cve.org/CVERecord?id=CVE-2026-25891","licence":"CVE Terms of Use","modified":"2026-02-24T21:39:11.118Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-m3c2-496v-cw3v","url":"https://github.com/advisories/GHSA-m3c2-496v-cw3v","licence":"CC-BY-4.0","modified":"2026-02-27T20:04:39.000Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-4540","url":"https://pkg.go.dev/vuln/GO-2026-4540","licence":"CC-BY-4.0","modified":"2026-02-26T19:11:12.151Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-25891","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25891","licence":"Public domain","modified":"2026-06-17T10:25:23.377Z"}],"updatedAt":"2026-11-25T22:59:14.786Z","epss":{"score":0.00693,"percentile":0.54152,"date":"2026-12-01T12:00:22.000Z"}}