CVE-2019-25211

parseWildcardRules in Gin-Gonic CORS middleware before 1.6.0 mishandles a wildcard at the end of an origin string, e.g., https://example.community/* is allowed…

Critical · published June 28, 2024

CVSS v3.1
9.1
EPSS
0%
Percentile
36.3
In the wild
Unconfirmed
What it is

🔥 A sneaky wildcard mishap in Gin-Gonic CORS middleware could leave your API wide open! Imagine a nightclub with a bouncer who mistakenly lets anyone in if their name simply ends in "*" — that's the kind of access issue we're talking about here! It's like an open invitation that should have been tightly controlled, but our bouncer just missed the point. This vulnerability allows attackers to access any origin that accidentally ends with a wildcard, potentially exposing sensitive data or enabling malicious behavior. An attacker could access restricted API endpoints simply by crafting an origin string that matches the flawed pattern, leading to disastrous consequences for your application.

Put simply

Imagine a nightclub with a bouncer who mistakenly lets anyone in if their name simply ends in "*" — that's the kind of access issue we're talking about here! It's like an open invitation that should have been tightly controlled, but our bouncer just missed the point. The issue lies in the `parseWildcardRules` function of the CORS middleware, allowing incorrectly configured wildcard origins to bypass intended restrictions. This means that origins like `https://example.community/*` can gain access when only `https://example.com/*` was meant to be allowed.

What to do

This vulnerability allows attackers to access any origin that accidentally ends with a wildcard, potentially exposing sensitive data or enabling malicious behavior. An attacker could access restricted API endpoints simply by crafting an origin string that matches the flawed pattern, leading to disastrous consequences for your application. Upgrade your Gin-Gonic CORS middleware to version 1.6.0 or later to close this critical gap. Additionally, review your CORS configuration to ensure that only the intended origins are allowed access, minimizing exposure to potential attacks. You've got this! With the right steps, you can secure your application and keep those unwanted guests out! 🛡️

The record
Technical detail
CVSS v3.1
9.1 · CRITICAL
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
CVSS v4.0
Not supplied
EPSS
0.00431 · 36.3th percentile
Published
2024-06-28T00:00Z
EPSS history
Timeline
  • 28 JUN 00:00Z
    parseWildcardRules in Gin-Gonic CORS middleware before 1.6.0 mishandles a wildcard at the end of an origin string, e.g., https://example.community/* is allowed…
    cvelistv5