# CVE-2023-29401: Improper handling of filenames in Content-Disposition HTTP header in github.com/gin-gonic/gin

- Severity: Medium 4.3 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.48%, higher than 43% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2023-05-11T18:59:56.000Z
- Modified: 2026-06-17T05:49:58.100Z
- Also known as: GHSA-2c4m-59x9-fr2g, GO-2023-1737
- Weaknesses: CWE-494
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: Go

## Description

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&quot;;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.

(As written by CVE List.)

## Affected

- github.com/gin-gonic/gin: from 1.3.1-0.20190301021747-ccb9e902956d before 1.9.1
- github.com/gin-gonic/gin (Go): from 1.3.1-0.20190301021747-ccb9e902956d before 1.9.1
- gin-gonic gin: from 1.3.1-0.20190301021747-ccb9e902956d before 1.9.1

## Every score

- CISA-ADP: CVSS:3.1 4.3 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N`
- GitHub: CVSS:3.1 4.3 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N`
- NVD: CVSS:3.1 4.3 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N`

## References

- <https://github.com/gin-gonic/gin/issues/3555> (exploit, issue-tracking, report, web)
- <https://github.com/gin-gonic/gin/pull/3556> (fix, issue-tracking, patch, web)
- <https://github.com/gin-gonic/gin/releases/tag/v1.9.1> (release-notes, web)
- <https://pkg.go.dev/vuln/GO-2023-1737> (third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2023-29401> (advisory)
- <https://github.com/gin-gonic/gin> (package)

## Sources

- CVE List: [CVE-2023-29401](https://www.cve.org/CVERecord?id=CVE-2023-29401), CVE Terms of Use, modified 2025-01-06
- GitHub Advisory Database: [GHSA-2c4m-59x9-fr2g](https://github.com/advisories/GHSA-2c4m-59x9-fr2g), CC-BY-4.0, modified 2023-11-08
- Go Vulnerability Database: [GO-2023-1737](https://pkg.go.dev/vuln/GO-2023-1737), CC-BY-4.0, modified 2024-05-20
- NVD: [CVE-2023-29401](https://nvd.nist.gov/vuln/detail/CVE-2023-29401), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2023-29401 · Whole record: https://cve.day/CVE-2023-29401.json · Rebuilt by cve.day 2026-11-25T22:58:24.687Z
