Security Digest · Vulnerability record

CVE-2024-25124: Fiber has Insecure CORS Configuration, Allowing Wildcard Origin with Credentials

Fiber is a web framework written in go. Prior to version 2.52.1, the CORS middleware allows for insecure configurations that could potentially expose the application to multiple CORS-related vulnerabilities.

CVSS 9.4 Critical EPSS 0.7% · p51

Should you act?

Critical and remotely reachable

No known exploitation yet, but it is network-reachable without credentials. This signal is computed from CISA KEV, EPSS and CVSS data; it is not an editorial verdict.

  • Not in CISA KEV, but CISA’s SSVC assessment records a public proof-of-concept, so attack code exists.
  • EPSS 0.7%, percentile 51: FIRST’s model estimates a 0.7% chance of exploitation activity in the next 30 days, higher than 51% of all scored CVEs (moderate). EPSS is a probability, not a verdict.
  • Remotely reachable with no login and no user interaction. If the vulnerable service is exposed to the internet, prioritize it.
  • Only applies if your dependency tree includes github.com/gofiber/fiber/v2 (Go) < 2.52.1, fixed in 2.52.1. Check your lockfile, including transitive dependencies.

What it is

Fiber is a web framework written in go. Prior to version 2.52.1, the CORS middleware allows for insecure configurations that could potentially expose the application to multiple CORS-related vulnerabilities. Specifically, it allows setting the Access-Control-Allow-Origin header to a wildcard () while also having the Access-Control-Allow-Credentials set to true, which goes against recommended security best practices. The impact of this misconfiguration is high as it can lead to unauthorized access to sensitive user data and expose the system to various types of attacks listed in the PortSwigger article linked in the references. Version 2.52.1 contains a patch for this issue. As a workaround, users may manually validate the CORS configurations in their implementation to ensure that they do not allow a wildcard origin when credentials are enabled. The browser fetch api, as well as browsers and utilities that enforce CORS policies, are not affected by this.

From the GitHub advisory

The CORS middleware allows for insecure configurations that could potentially expose the application to multiple CORS-related vulnerabilities. Specifically, it allows setting the Access-Control-Allow-Origin header to a wildcard ("") while also having the Access-Control-Allow-Credentials set to true, which goes against recommended security best practices.

Impact The impact of this misconfiguration is high as it can lead to unauthorized access to sensitive user data and expose the system to various types of attacks listed in the PortSwigger article linked in the references.

Proof of Concept The code in cors.go allows setting a wildcard in the AllowOrigins while having AllowCredentials set to true, which could lead to various vulnerabilities.

Potential Solution Here is a potential solution to ensure the CORS configuration is secure:

Workarounds For the meantime, users are advised to manually validate the CORS configurations in their implementation to ensure that they do not allow a wildcard origin when credentials are enabled. The browser fetch api, browsers and utilities that enforce CORS policies are not affected by this.

Weakness type: CWE-346, CWE-942.

Product: github.com/gofiber/fiber/v2 (Go) · Assigned by: GitHub_M · Published: 2024-02-21

Affected and fixed versions

EcosystemPackageVulnerableFirst fixed
Gogithub.com/gofiber/fiber/v2< 2.52.12.52.1
VendorProductAffected versions (per CVE record)
gofiberfiber< 2.52.1

Severity scores

Scored byCVSSScoreVector
GitHub_M3.19.4 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L
GitHub3.19.4 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L
  • Attack vector: network (remotely reachable)
  • Attack complexity: low
  • Privileges required: none (no login)
  • User interaction: none
  • Scope: unchanged

CVSS measures how bad a flaw is if exploited, not how likely exploitation is. Read it next to the exploitation data below.

Exploitation and urgency

  • CISA KEV: not listed (no confirmed in-the-wild exploitation known to CISA).
  • CISA SSVC assessment: exploitation poc, automatable no, technical impact total.
  • FIRST EPSS (model of 2026-10-21): 0.66% probability of exploitation activity in the next 30 days; percentile 51.

Timeline

  • — CVE record published by GitHub_M
  • — GitHub-reviewed advisory GHSA-fmg4-x8pw-hjhg published (critical)
  • — CVE record last updated

Sources and references

Original sources first. Version and fix details should always be confirmed against the vendor or project advisory.

Vulnerability records

  1. GitHub Advisory GHSA-fmg4-x8pw-hjhg github.com
  2. CVE.org record CVE-2024-25124 cve.org
  3. NVD entry CVE-2024-25124 nvd.nist.gov

Other references from the CVE record and advisory

  1. github.com github.com
  2. github.com github.com
  3. codeql.github.com codeql.github.com
  4. developer.mozilla.org developer.mozilla.org
  5. fetch.spec.whatwg.org fetch.spec.whatwg.org
  6. github.com github.com
  7. saturncloud.io saturncloud.io
  8. blog.portswigger.net blog.portswigger.net

Critical Go advisories · Today’s Security Digest