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";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.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| github.com/gin-gonic/gin | github.com/gin-gonic/gin | 1.3.1-0.20190301021747-ccb9e902956d – < 1.9.1 | 1.9.1 |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | golang-github-gin-gonic-gin | 1.8.1-3 | — |
| Debian 13 | golang-github-gin-gonic-gin | 1.8.1-3 | — |
| Debian 12 | golang-github-gin-gonic-gin | No fix yet | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | golang-github-gin-gonic-gin | No fix yet | — |
| Ubuntu 26.04 LTS | golang-github-gin-gonic-gin | No fix yet | — |
| Ubuntu 25.10 | golang-github-gin-gonic-gin | No fix yet | — |
| Ubuntu 24.04 LTS | golang-github-gin-gonic-gin | No fix yet | — |
| Ubuntu 22.04 LTS | golang-github-gin-gonic-gin | No fix yet | — |
Show 2 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 20.04 LTS | golang-github-gin-gonic-gin | No fix yet | — |
| Ubuntu 18.04 LTS | golang-github-gin-gonic-gin | No fix yet | — |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
GitHub 1 repository
-
dannyEndorTest/gin-vulnerable ★ 0 · May 20, 2026
Demo consumer for gin v1.7.0 (CVE-2023-29401) — Context.FileAttachment with user input. endorctl scan target.
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| Go | github.com/gin-gonic/gin | >= 1.3.1-0.20190301021747-ccb9e902956d, < 1.9.1 | 1.9.1 | GHSA-2c4m-59x9-fr2g |
Advisories 1
- WID-SEC-2024-3370 Red Hat OpenShift: Schwachstelle ermöglicht Umgehen von Sicherheitsvorkehrungen BSI CERT-Bund (WID) · Nov 7, 2024