Vulnerabilities in pkg:golang/github.com/gin-gonic/gin
PACKAGECVE-2019-25211 is a CRITICAL (CVSS 9.1) gin mishandles a wildcard at vulnerability (CWE-346: Origin Validation Error) affecting Github.com/gin gonic/gin libraries in the Go ecosystem. The issue involves gin mishandles a wildcard at the end of an origin string. Remediation is available by upgrading affected packages to version 1.6.0.
pkg:golang/github.com/gin-gonic/gin
Vulnerability advisories affecting package pkg:golang/github.com/gin-gonic/gin. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-869c-j7wc-8jqv | CVE-2019-25211 | CRITICAL | Gin mishandles a wildcard at the end of an origin string |
| GHSA-h395-qcrw-5vmq | CVE-2020-28483 | HIGH | Inconsistent Interpretation of HTTP Requests in github.com/gin-gonic/gin |
| GHSA-2c4m-59x9-fr2g | CVE-2023-29401 | MODERATE | Gin Web Framework does not properly sanitize filename parameter of Context.FileAttachment function |
| GHSA-3vp4-m3rf-835h | CVE-2023-26125 | MODERATE | Improper input validation in github.com/gin-gonic/gin |
| GHSA-6vm3-jj99-7229 | CVE-2020-36567 | HIGH | Gin's default logger allows unsanitized input that can allow remote attackers to inject arbitrary log lines |
CVE-2019-25211 at a Glance
Security Impact
CVSS: 9.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N).
How to Fix CVE-2019-25211
To remediate this vulnerability, upgrade all affected Github.com/gin gonic/gin 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/gin-gonic/gin to 1.6.0
Upgrade github.com/gin-contrib/cors to 1.6.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/gin-gonic/gin
How to Check if You Are Affected
To determine whether your application is affected by CVE-2019-25211, inspect your project dependencies for Github.com/gin gonic/gin:
inspect dependencies for github.com/gin-gonic/gin
Analyze the terminal output to locate any version of Github.com/gin gonic/gin in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.6.0), 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-346: Origin Validation Error, where the product does not properly verify that the source of data or communication is valid. In Github.com/gin gonic/gin, 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-2019-25211 Affected Github.com/gin gonic/gin Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/gin-gonic/gin
|
Go |
< 1.6.0
|
1.6.0
|
|
github.com/gin-contrib/cors
|
Go |
< 1.6.0
|
1.6.0
|
References
Frequently Asked Questions
What is CVE-2019-25211?
Which Github.com/gin gonic/gin versions are affected?
What version fixes CVE-2019-25211?
Is github.com/gin-gonic/gin affected?
Is github.com/gin-contrib/cors affected?
What is the CVSS score of CVE-2019-25211?
What CWE is associated with CVE-2019-25211?
How can I check Go dependencies for CVE-2019-25211?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-869c-j7wc-8jqv",
"modified" : "2025-11-03T22:47:01Z",
"published" : "2024-06-29T06:31:40Z",
"aliases" : [ "CVE-2019-25211" ],
"summary" : "Gin mishandles a wildcard at the end of an origin string",
"details" : "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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/gin-gonic/gin"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.6.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/gin-contrib/cors"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.6.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-25211"
}, {
"type" : "WEB",
"url" : "https://github.com/gin-contrib/cors/pull/106"
}, {
"type" : "WEB",
"url" : "https://github.com/gin-contrib/cors/pull/57"
}, {
"type" : "WEB",
"url" : "https://github.com/gin-contrib/cors/commit/27b723a473efd80d5a498fa9f5933c80204c850d"
}, {
"type" : "WEB",
"url" : "https://github.com/gin-contrib/cors/compare/v1.5.0...v1.6.0"
}, {
"type" : "WEB",
"url" : "https://github.com/gin-contrib/cors/releases/tag/v1.6.0"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/gin-gonic/gin"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2025/08/msg00024.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-346" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2024-07-01T21:30:24Z",
"nvd_published_at" : "2024-06-29T00:15:02Z"
}
}