{"id":"CVE-2025-54801","aliases":["CVE-2025-54801","GHSA-qx2q-88mx-vhg7","GO-2025-3845"],"related":["CGA-vp7x-3q95-x4wq"],"kind":"vulnerability","state":"published","title":"Fiber Susceptible to Crash via `BodyParser` Due to Unvalidated Large Slice Index in Decoder","summary":"Fiber is an Express inspired web framework written in Go. In versions 2.52.8 and below, when using Fiber's Ctx.BodyParser to parse form data containing a large numeric key that represents a slice index (e.g., test.18446744073704), the application crashes due to an out-of-bounds slice allocation in the underlying schema decoder. The root cause is that the decoder attempts to allocate a slice of length idx + 1 without validating whether the index is within a safe or reasonable range. If the idx is excessively large, this leads to an integer overflow or memory exhaustion, causing a panic or crash. This is fixed in version 2.52.9.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Fiber is an Express inspired web framework written in Go. In versions 2.52.8 and below, when using Fiber's Ctx.BodyParser to parse form data containing a large numeric key that represents a slice index (e.g., test.18446744073704), the application crashes due to an out-of-bounds slice allocation in the underlying schema decoder. The root cause is that the decoder attempts to allocate a slice of length idx + 1 without validating whether the index is within a safe or reasonable range. If the idx is excessively large, this leads to an integer overflow or memory exhaustion, causing a panic or crash. This is fixed in version 2.52.9.","source":"cvelist"},{"lang":"en","text":"### Description\n\nWhen using Fiber's `Ctx.BodyParser` to parse form data containing a large numeric key that represents a slice index (e.g., `test.18446744073704`), the application crashes due to an out-of-bounds slice allocation in the underlying schema decoder.\n\nThe root cause is that the decoder attempts to allocate a slice of length `idx + 1` without validating whether the index is within a safe or reasonable range. If `idx` is excessively large, this leads to an integer overflow or memory exhaustion, causing a panic or crash.\n\n\n### Steps to Reproduce\n\nCreate a POST request handler that accepts `x-www-form-urlencoded` data\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\n\t\"github.com/gofiber/fiber/v2\"\n)\n\ntype RequestBody struct {\n\tNestedContent []*struct{} `form:\"test\"`\n}\n\nfunc main() {\n\tapp := fiber.New()\n\n\tapp.Post(\"/\", func(c *fiber.Ctx) error {\n\t\tformData := RequestBody{}\n\t\tif err := c.BodyParser(&formData); err != nil {\n\t\t\tfmt.Println(err)\n\t\t\treturn c.SendStatus(http.StatusUnprocessableEntity)\n\t\t}\n\t\treturn nil\n\t})\n\n\tfmt.Println(app.Listen(\":3000\"))\n}\n\n```\n\nRun the server and send a POST request with a large numeric key in form data, such as:\n\n```bash\ncurl -v -X POST localhost:3000 --data-raw 'test.18446744073704' \\\n  -H 'Content-Type: application/x-www-form-urlencoded'\n```\n\n\n### Relevant Code Snippet\n\nWithin the decoder's [decode method](https://github.com/gofiber/fiber/blob/v2.52.8/internal/schema/decoder.go#L249):\n\n```go\nidx := parts[0].index\nif v.IsNil() || v.Len() < idx+1 {\n    value := reflect.MakeSlice(t, idx+1, idx+1)  // <-- Panic/crash occurs here when idx is huge\n    if v.Len() < idx+1 {\n        reflect.Copy(value, v)\n    }\n    v.Set(value)\n}\n```\n\nThe `idx` is not validated before use, leading to unsafe slice allocation for extremely large values.\n\n---\n\n### Impact\n\n- Application panic or crash on malicious or malformed input.\n- Potential denial of service (DoS) via memory exhaustion or server crash.\n- Lack of defensive checks in the parsing code causes instability.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Fiber Crashes in BodyParser Due to Unvalidated Large Slice Index in Decoder in github.com/gofiber/fiber","format":"markdown","source":"go"},{"lang":"es","text":"Fiber es un framework web inspirado en Express y escrito en Go. En las versiones 2.52.8 y anteriores, al usar Ctx.BodyParser de Fiber para analizar datos de formulario que contienen una clave numérica grande que representa el índice de un segmento (p. ej., test.18446744073704), la aplicación se bloquea debido a una asignación de segmento fuera de los límites en el decodificador de esquema subyacente. La causa principal es que el decodificador intenta asignar un segmento con una longitud de idx + 1 sin validar si el índice se encuentra dentro de un rango seguro o razonable. Si el idx es excesivamente grande, se produce un desbordamiento de enteros o un agotamiento de memoria, lo que provoca un pánico o un bloqueo. Esto se solucionó en la versión 2.52.9.","source":"nvd"}],"published":"2025-08-05T15:22:21.000Z","modified":"2026-09-10T03:50:27.479Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","score":8.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:N/VI:N/VA:H/SC:N/SI:N/SA:N","score":8.7,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/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:N/I:N/A:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-789"],"affected":[{"ranges":[{"version":"< 2.52.9","status":"affected"}],"vendor":"gofiber","product":"fiber","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.52.9"}],"ecosystem":"Go","package":"github.com/gofiber/fiber/v2","purl":"pkg:golang/github.com/gofiber/fiber/v2","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.52.9"}],"ecosystem":"Go","package":"github.com/gofiber/fiber/v2","purl":"pkg:golang/github.com/gofiber/fiber/v2","source":"go"},{"ranges":[{"status":"affected","fixed":"2.52.9"}],"vendor":"gofiber","product":"fiber","cpe":"cpe:2.3:a:gofiber:fiber:*:*:*:*:*:go:*:*","source":"nvd"}],"references":[{"url":"https://github.com/gofiber/fiber/security/advisories/GHSA-qx2q-88mx-vhg7","tags":["advisory","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/gofiber/fiber/commit/e115c08b8f059a4a031b492aa9eef0712411853d","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-54801","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/gofiber/fiber","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2025-08-07T13:59:43.620Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-54801","url":"https://www.cve.org/CVERecord?id=CVE-2025-54801","licence":"CVE Terms of Use","modified":"2025-08-07T14:00:09.981Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-qx2q-88mx-vhg7","url":"https://github.com/advisories/GHSA-qx2q-88mx-vhg7","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:27.479Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2025-3845","url":"https://pkg.go.dev/vuln/GO-2025-3845","licence":"CC-BY-4.0","modified":"2026-02-04T02:57:36.768Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-54801","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-54801","licence":"Public domain","modified":"2026-06-17T09:40:43.787Z"}],"updatedAt":"2026-11-25T22:59:02.074Z","epss":{"score":0.00424,"percentile":0.38677,"date":"2026-12-01T12:00:22.000Z"}}