Skip to content
OpenAdvisories
Medium · 4.3 Public exploit CVE-2023-29401 EUVD-2023-1445GHSA-2c4m-59x9-fr2gGO-2023-1737

Improper handling of filenames in Content-Disposition HTTP header in github.com/gin-gonic/gin

Published Jun 8, 2023 · Updated Jan 6, 2025 · 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";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

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

ReleasePackageFixed inAdvisory
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 —
ReleasePackageFixed inAdvisory
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)
ReleasePackageFixed inAdvisory
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.

Third-party code, not reviewed by us. Public PoCs are sometimes fake or contain malware. Read the code first and run it only in an isolated lab, against systems you are authorised to test.

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

EcosystemPackageAffectedFixedRecord
Go github.com/gin-gonic/gin >= 1.3.1-0.20190301021747-ccb9e902956d, < 1.9.1 1.9.1 GHSA-2c4m-59x9-fr2g

Advisories 1

References