Vulnerabilities in pkg:golang/github.com/gin-contrib/cors

PACKAGE
Advisory Identifier: GHSA-869c-j7wc-8jqv
Advisory Summary

CVE-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.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/gin-contrib/cors

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/gin-contrib/cors. 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

CVE-2019-25211 at a Glance

CVE Identifier CVE-2019-25211
GHSA Identifier GHSA-869c-j7wc-8jqv
Severity CRITICAL
CVSS v3.1 Base Score 9.1
CWE Classification CWE-346: Origin Validation Error
Affected Product Github.com/gin gonic/gin
Package Ecosystem Go
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (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.

github.com/gin-gonic/gin fixed: 1.6.0
Upgrade github.com/gin-gonic/gin to 1.6.0
github.com/gin-contrib/cors fixed: 1.6.0
Upgrade github.com/gin-contrib/cors to 1.6.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/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

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.

CVE-2019-25211 Affected Github.com/gin gonic/gin Versions

2 component(s)
Fixed Versions:
1.6.0
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?
CVE-2019-25211 is a security vulnerability in Github.com/gin gonic/gin involving Gin mishandles a wildcard at the end of an origin string under CWE-346: Origin Validation Error.
Which Github.com/gin gonic/gin versions are affected?
Affected versions include releases prior to 1.6.0 across affected packages: github.com/gin-gonic/gin, github.com/gin-contrib/cors.
What version fixes CVE-2019-25211?
Upgrading to 1.6.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/gin-gonic/gin affected?
Yes, github.com/gin-gonic/gin is affected in releases prior to 1.6.0. Upgrade your dependency to 1.6.0 or later.
Is github.com/gin-contrib/cors affected?
Yes, github.com/gin-contrib/cors is affected in releases prior to 1.6.0. Upgrade your dependency to 1.6.0 or later.
What is the CVSS score of CVE-2019-25211?
CVE-2019-25211 has a CVSS v3.1 base score of 9.1 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2019-25211?
CVE-2019-25211 is classified under CWE-346: Origin Validation Error (The product does not properly verify that the source of data or communication is valid.).
How can I check Go dependencies for CVE-2019-25211?
Run the dependency tree command: 'inspect dependencies for github.com/gin-gonic/gin'. 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-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"
  }
}