CVE-2023-29401: Github.com/gin gonic/gin Gin Web Framework Does Not Vulnerability
MODERATECVE-2023-29401 is a MODERATE (CVSS 4.3) gin web framework does not vulnerability (CWE-494: Download of Code Without Integrity Check) affecting Github.com/gin gonic/gin libraries in the Go ecosystem. The issue involves gin web framework does not properly sanitize filename parameter of context.fileattachment function. Remediation is available by upgrading affected packages to version 1.9.1.
CVE-2023-29401 at a Glance
Security Impact
CVSS: 4.3
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:R/S:U/C:N/I:L/A:N).
How to Fix CVE-2023-29401
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.9.1
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-29401, 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.1), 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-494: Download of Code Without Integrity Check, where the product downloads source code or an executable from a remote location and executes the code without sufficiently verifying the origin and integrity of the code. 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-2023-29401 Affected Github.com/gin gonic/gin Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/gin-gonic/gin
|
Go |
≥ 1.3.1-0.20190301021747-ccb9e902956d
< 1.9.1
|
1.9.1
|
References
Frequently Asked Questions
What is CVE-2023-29401?
Which Github.com/gin gonic/gin versions are affected?
What version fixes CVE-2023-29401?
Is github.com/gin-gonic/gin affected?
What is the CVSS score of CVE-2023-29401?
What CWE is associated with CVE-2023-29401?
How can I check Go dependencies for CVE-2023-29401?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-2c4m-59x9-fr2g",
"modified" : "2023-06-16T17:57:38Z",
"published" : "2023-05-12T20:19:25Z",
"aliases" : [ "CVE-2023-29401" ],
"summary" : "Gin Web Framework does not properly sanitize filename parameter of Context.FileAttachment function",
"details" : "The filename parameter of the Context.FileAttachment function is not properly sanitized. A maliciously crafted filename can cause the Content-Disposition header to be sent with an unexpected filename value or otherwise modify the Content-Disposition header. For example, a filename of \"setup.bat";x=.txt\" will be sent as a file named \"setup.bat\".\n\nIf the FileAttachment function is called with names provided by an untrusted source, this may permit an attacker to cause a file to be served with a name different than provided. Maliciously crafted attachment file name can modify the Content-Disposition header.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/gin-gonic/gin"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.3.1-0.20190301021747-ccb9e902956d"
}, {
"fixed" : "1.9.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-29401"
}, {
"type" : "WEB",
"url" : "https://github.com/gin-gonic/gin/issues/3555"
}, {
"type" : "WEB",
"url" : "https://github.com/gin-gonic/gin/pull/3556"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/gin-gonic/gin"
}, {
"type" : "WEB",
"url" : "https://github.com/gin-gonic/gin/releases/tag/v1.9.1"
}, {
"type" : "WEB",
"url" : "https://pkg.go.dev/vuln/GO-2023-1737"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-494" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-05-12T20:19:25Z",
"nvd_published_at" : "2023-06-08T21:15:16Z"
}
}