Loading...
Skip to main content

CVE-2019-25211

CRITICAL

Gin mishandles a wildcard at the end of an origin string

Published June 29, 2024Updated November 3, 2025Source: osv

Summary

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 when the intention is that only https://example.com/* should be allowed, and http://localhost.example.com/* is allowed when the intention is that only http://localhost/* should be allowed.

Remediation

Upgrade to the fixed version using your package manager.

Go
Update github.com/gin-contrib/cors to 1.6.0 or later
go get github.com/gin-contrib/cors@v1.6.0
Go
Update github.com/gin-gonic/gin to 1.6.0 or later
go get github.com/gin-gonic/gin@v1.6.0

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (2)

PackageEcosystemAffectedFixed In
github.com/gin-contrib/cors
go
All versions1.6.0
github.com/gin-gonic/gin
go
All versions1.6.0

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-346
    Origin Validation ErrorMITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.1 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N

Frequently Asked Questions

What is CVE-2019-25211?
Gin mishandles a wildcard at the end of an origin string This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.1/10).
How do I check if my project is affected by CVE-2019-25211?
CVE-2019-25211 affects github.com/gin-contrib/cors and github.com/gin-gonic/gin. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2019-25211 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
9.1

Exploitation is straightforward and causes maximum impact. Patch immediately.

Also Known As

GHSA-869c-j7wc-8jqv
GO-2024-2955

Related CVEs

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies