{"id":"CVE-2026-25899","aliases":["CVE-2026-25899","GHSA-2mr3-m5q5-wgp6","GO-2026-4534"],"related":[],"kind":"vulnerability","state":"published","title":"Fiber is Vulnerable to Denial of Service via Flash Cookie Unbounded Allocation","summary":"Fiber is an Express inspired web framework written in Go. In versions on the v3 branch prior to 3.1.0, the use of the `fiber_flash` cookie can force an unbounded allocation on any server. A crafted 10-character cookie value triggers an attempt to allocate up to 85GB of memory via unvalidated msgpack deserialization. No authentication is required. Every GoFiber v3 endpoint is affected regardless of whether the application uses flash messages. Version 3.1.0 fixes the issue.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Fiber is an Express inspired web framework written in Go. In versions on the v3 branch prior to 3.1.0, the use of the `fiber_flash` cookie can force an unbounded allocation on any server. A crafted 10-character cookie value triggers an attempt to allocate up to 85GB of memory via unvalidated msgpack deserialization. No authentication is required. Every GoFiber v3 endpoint is affected regardless of whether the application uses flash messages. Version 3.1.0 fixes the issue.","source":"cvelist"},{"lang":"en","text":"### Summary\nThe use of the `fiber_flash` cookie can force an unbounded allocation on any server. A crafted 10-character cookie value triggers an attempt to allocate up to 85GB of memory via unvalidated msgpack deserialization. No authentication is required. Every GoFiber v3 endpoint is affected regardless of whether the application uses flash messages.\n\n### Details\nRegardless of configuration, the flash cookie is checked:\n\n```go\nfunc (app *App) requestHandler(rctx *fasthttp.RequestCtx) {\n\t// Acquire context from the pool\n\tctx := app.AcquireCtx(rctx)\n\tdefer app.ReleaseCtx(ctx)\n\n\t\t// Optional: Check flash messages\n\t\trawHeaders := d.Request().Header.RawHeaders()\n\t\tif len(rawHeaders) > 0 && bytes.Contains(rawHeaders, flashCookieNameBytes) {\n\t\t\td.Redirect().parseAndClearFlashMessages()\n\t\t}\n\t\t_, err = app.next(d)\n\t} else {\n\t\t// Check if the HTTP method is valid\n\t\tif ctx.getMethodInt() == -1 {\n\t\t\t_ = ctx.SendStatus(StatusNotImplemented) //nolint:errcheck // Always return nil\n\t\t\treturn\n\t\t}\n\n\t\t// Optional: Check flash messages\n\t\trawHeaders := ctx.Request().Header.RawHeaders()\n\t\tif len(rawHeaders) > 0 && bytes.Contains(rawHeaders, flashCookieNameBytes) {\n\t\t\tctx.Redirect().parseAndClearFlashMessages()\n\t\t}\n}\n```\n\nThe cookie value is hex-decoded and passed directly to msgpack deserialization with no size or content validation:\n\nhttps://github.com/gofiber/fiber/blob/f8f34f642fb3682c341ede7816e7cf861aa7df89/redirect.go#L371\n\n```go\n// parseAndClearFlashMessages is a method to get flash messages before they are getting removed\nfunc (r *Redirect) parseAndClearFlashMessages() {\n\t// parse flash messages\n\tcookieValue, err := hex.DecodeString(r.c.Cookies(FlashCookieName))\n\tif err != nil {\n\t\treturn\n\t}\n\n\t_, err = r.c.flashMessages.UnmarshalMsg(cookieValue)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tr.c.Cookie(&Cookie{\n\t\tName:   FlashCookieName,\n\t\tValue:  \"\",\n\t\tPath:   \"/\",\n\t\tMaxAge: -1,\n\t})\n}\n```\n\nThe auto-generated `tinylib/msgp` deserialization reads a `uint32` array header from the attacker-controlled byte stream and passes it directly to `make()` with no bounds check:\n\nhttps://github.com/gofiber/fiber/blob/f8f34f642fb3682c341ede7816e7cf861aa7df89/redirect_msgp.go#L242\n\n```go\n// UnmarshalMsg implements msgp.Unmarshaler\nfunc (z *redirectionMsgs) UnmarshalMsg(bts []byte) (o []byte, err error) {\n\tvar zb0002 uint32\n\tzb0002, bts, err = msgp.ReadArrayHeaderBytes(bts)\n\tif err != nil {\n\t\terr = msgp.WrapError(err)\n\t\treturn o, err\n\t}\n\tif cap((*z)) >= int(zb0002) {\n\t\t(*z) = (*z)[:zb0002]\n\t} else {\n\t\t(*z) = make(redirectionMsgs, zb0002)\n\t}\n\tfor zb0001 := range *z {\n\t\tbts, err = (*z)[zb0001].UnmarshalMsg(bts)\n\t\tif err != nil {\n\t\t\terr = msgp.WrapError(err, zb0001)\n\t\t\treturn o, err\n\t\t}\n\t}\n\to = bts\n\treturn o, err\n}\n```\n\nwhere\n `zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts)` translates the attacker-controlled value into the element count and `make(redirectionMsgs, zb0002)` performs the unbounded allocation\n\nSo we can craft a gofiber cookie that will force a huge allocation: \n`curl -H \"Cookie: fiber_flash=dd7fffffff\" http://localhost:5000/hello`\n\nThe cookie val is a hex-encoded msgpack array32 header:\n- `dd` = msgpack array32 marker\n- `7fffffff` = 2 147 483 647 elements\n\n### Impact\nUnauthenticated remote Denial of Service (CWE-789). Anyone running a gofiber v3.0.0 or v3 server is affected. The flash cookie parsing is hardcoded.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Fiber is Vulnerable to Denial of Service via Flash Cookie Unbounded Allocation in github.com/gofiber/fiber/v3","format":"markdown","source":"go"},{"lang":"es","text":"Fiber es un framework web inspirado en Express escrito en Go. En versiones de la rama v3 anteriores a la 3.1.0, el uso de la 'cookie' fiber_flash puede forzar una asignación ilimitada en cualquier servidor. Un valor de cookie manipulado de 10 caracteres desencadena un intento de asignar hasta 85 GB de memoria a través de una deserialización msgpack no validada. No se requiere autenticación. Cada endpoint de GoFiber v3 se ve afectado independientemente de si la aplicación utiliza mensajes flash. La versión 3.1.0 corrige el problema.","source":"nvd"}],"published":"2026-02-24T20:57:25.000Z","modified":"2026-06-17T10:25:24.327Z","severity":{"scorer":"GitHub_M","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"},"severities":[{"scorer":"GitHub_M","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"},{"scorer":"GitHub","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-770","CWE-789"],"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-2mr3-m5q5-wgp6","tags":["advisory","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/gofiber/fiber/releases/tag/v3.1.0","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25899","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/gofiber/fiber","tags":["package"],"sources":["ghsa"]},{"url":"https://pkg.go.dev/vuln/GO-2026-4534","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-02-24T21:37:21.605Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-25899","url":"https://www.cve.org/CVERecord?id=CVE-2026-25899","licence":"CVE Terms of Use","modified":"2026-02-24T21:37:33.970Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-2mr3-m5q5-wgp6","url":"https://github.com/advisories/GHSA-2mr3-m5q5-wgp6","licence":"CC-BY-4.0","modified":"2026-02-27T20:37:07.000Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-4534","url":"https://pkg.go.dev/vuln/GO-2026-4534","licence":"CC-BY-4.0","modified":"2026-02-26T18:56:15.314Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-25899","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25899","licence":"Public domain","modified":"2026-06-17T10:25:24.327Z"}],"updatedAt":"2026-11-25T22:59:14.786Z","epss":{"score":0.00445,"percentile":0.40404,"date":"2026-12-01T12:00:22.000Z"}}