CVE-2025-54801: Github.com/gofiber/fiber/v2 Fiber Crashes Vulnerability
HIGHCVE-2025-54801 is a HIGH fiber crashes vulnerability (CWE-789: Memory Allocation with Excessive Size Value) affecting Github.com/gofiber/fiber/v2 libraries in the Go ecosystem. The issue involves fiber crashes in bodyparser due to unvalidated large slice index in decoder. Remediation is available by upgrading affected packages to version 2.52.9.
CVE-2025-54801 at a Glance
How to Fix CVE-2025-54801
To remediate this vulnerability, upgrade all affected Github.com/gofiber/fiber/v2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/gofiber/fiber/v2 to 2.52.9
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/gofiber/fiber/v2
How to Check if You Are Affected
To determine whether your application is affected by CVE-2025-54801, inspect your project dependencies for Github.com/gofiber/fiber/v2:
inspect dependencies for github.com/gofiber/fiber/v2
Analyze the terminal output to locate any version of Github.com/gofiber/fiber/v2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.52.9), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-789: Memory Allocation with Excessive Size Value, where the product allocates memory based on an untrusted, large size value, but it does not ensure that the size is within expected limits, allowing arbitrary amounts of memory to be allocated. In Github.com/gofiber/fiber/v2, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-54801 Affected Github.com/gofiber/fiber/v2 Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/gofiber/fiber/v2
|
Go |
< 2.52.9
|
2.52.9
|
References
Frequently Asked Questions
What is CVE-2025-54801?
Which Github.com/gofiber/fiber/v2 versions are affected?
What version fixes CVE-2025-54801?
Is github.com/gofiber/fiber/v2 affected?
What CWE is associated with CVE-2025-54801?
How can I check Go dependencies for CVE-2025-54801?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-qx2q-88mx-vhg7",
"modified" : "2025-08-06T14:31:40Z",
"published" : "2025-08-05T15:22:21Z",
"aliases" : [ "CVE-2025-54801" ],
"summary" : "Fiber Crashes in BodyParser Due to Unvalidated Large Slice Index in Decoder",
"details" : "### 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.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/gofiber/fiber/v2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.52.9"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 2.52.8"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/gofiber/fiber/security/advisories/GHSA-qx2q-88mx-vhg7"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-54801"
}, {
"type" : "WEB",
"url" : "https://github.com/gofiber/fiber/commit/e115c08b8f059a4a031b492aa9eef0712411853d"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/gofiber/fiber"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-789" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2025-08-05T15:22:21Z",
"nvd_published_at" : "2025-08-06T00:15:31Z"
}
}