CVE-2023-26125: Github.com/gin gonic/gin Improper Input Validation Vulnerability

MODERATE
Advisory Identifier: GHSA-3vp4-m3rf-835h
CVSS 5.6
CWE-20 CWE-77
Published
Advisory Summary

CVE-2023-26125 is a MODERATE (CVSS 5.6) improper input validation vulnerability (CWE-20: Improper Input Validation) affecting Github.com/gin gonic/gin libraries in the Go ecosystem. The issue involves improper input validation in github.com/gin-gonic/gin. Remediation is available by upgrading affected packages to version 1.9.0.

CVE-2023-26125 at a Glance

CVE Identifier CVE-2023-26125
GHSA Identifier GHSA-3vp4-m3rf-835h
Severity MODERATE
CVSS v3.1 Base Score 5.6
CWE Classification CWE-20: Improper Input Validation
Affected Product Github.com/gin gonic/gin
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.6

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2023-26125

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.9.0
Upgrade github.com/gin-gonic/gin to 1.9.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-2023-26125, 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.9.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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. 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

Versions of the package github.com/gin-gonic/gin before version 1.9.0 are vulnerable to Improper Input Validation by allowing an attacker to use a specially crafted request via the X-Forwarded-Prefix header, potentially leading to cache poisoning. **Note:** Although this issue does not pose a significant threat on its own it can serve as an input vector for other more impactful vulnerabilities. However, successful exploitation may depend on the server configuration and whether the header is used in the application logic.

CVE-2023-26125 Affected Github.com/gin gonic/gin Versions

1 component(s)
Fixed Versions:
1.9.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/gin-gonic/gin
Go
< 1.9.0
1.9.0

References

Frequently Asked Questions

What is CVE-2023-26125?
CVE-2023-26125 is a security vulnerability in Github.com/gin gonic/gin involving Improper input validation in github.com/gin-gonic/gin under CWE-20: Improper Input Validation.
Which Github.com/gin gonic/gin versions are affected?
Affected versions include releases prior to 1.9.0 across affected packages: github.com/gin-gonic/gin.
What version fixes CVE-2023-26125?
Upgrading to 1.9.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.9.0. Upgrade your dependency to 1.9.0 or later.
What is the CVSS score of CVE-2023-26125?
CVE-2023-26125 has a CVSS v3.1 base score of 5.6 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L.
What CWE is associated with CVE-2023-26125?
CVE-2023-26125 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check Go dependencies for CVE-2023-26125?
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-3vp4-m3rf-835h",
  "modified" : "2023-05-11T14:03:52Z",
  "published" : "2023-05-04T06:30:12Z",
  "aliases" : [ "CVE-2023-26125" ],
  "summary" : "Improper input validation in github.com/gin-gonic/gin",
  "details" : "Versions of the package github.com/gin-gonic/gin before version 1.9.0 are vulnerable to Improper Input Validation by allowing an attacker to use a specially crafted request via the X-Forwarded-Prefix header, potentially leading to cache poisoning.\n\n**Note:** Although this issue does not pose a significant threat on its own it can serve as an input vector for other more impactful vulnerabilities. However, successful exploitation may depend on the server configuration and whether the header is used in the application logic.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/gin-gonic/gin"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.9.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-26125"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gin-gonic/gin/pull/3500"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gin-gonic/gin/pull/3503"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/t0rchwo0d/gin/commit/fd9f98e70fb4107ee68c783482d231d35e60507b"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/gin-gonic/gin"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gin-gonic/gin/releases/tag/v1.9.0"
  }, {
    "type" : "WEB",
    "url" : "https://security.snyk.io/vuln/SNYK-GOLANG-GITHUBCOMGINGONICGIN-3324285"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20", "CWE-77" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-05-05T02:20:00Z",
    "nvd_published_at" : "2023-05-04T05:15:09Z"
  }
}