Advisory Database
  • Advisories
  • Dependency Scanning
  1. golang
  2. ›
  3. github.com/gin-gonic/gin
  4. ›
  5. CVE-2023-29401

CVE-2023-29401: Gin Web Framework does not properly sanitize filename parameter of Context.FileAttachment function

June 8, 2023 (updated June 16, 2023)

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

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

References

  • github.com/advisories/GHSA-2c4m-59x9-fr2g
  • github.com/gin-gonic/gin/issues/3555
  • github.com/gin-gonic/gin/pull/3556
  • pkg.go.dev/vuln/GO-2023-1737

Code Behaviors & Features

Detect and mitigate CVE-2023-29401 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 1.3.1-0.20190301021747-ccb9e902956d before 1.9.1

Fixed versions

  • v1.9.1

Solution

Upgrade to version 1.9.1 or above.

Impact 4.3 MEDIUM

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

Learn more about CVSS

Weakness

  • CWE-494: Download of Code Without Integrity Check

Source file

go/github.com/gin-gonic/gin/CVE-2023-29401.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:16:14 +0000.