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

Published May 12, 2023
·
Updated

Gin-Gonic Gin Web Framework could allow a remote attacker to bypass security restrictions, caused by improper input validation by the filename parameter of the Context.FileAttachment function. By using a specially-crafted attachment file name, an attacker could exploit this vulnerability to modify the Content-Disposition header.

Other sources

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 Software

5 affected componentsFixes available
go/github.com/gin-gonic/gin>=1.3.1-0.20190301021747-ccb9e902956d<1.9.1
1.9.1
gin-gonic gin>=1.3.1-0.20190301021747-ccb9e902956d<1.9.1
IBM Planning Analytics Local - IBM Planning Analytics Workspace<=2.1
IBM Planning Analytics Local - IBM Planning Analytics Workspace<=2.0
redhat/golang-github-gin-gonic-gin<1.9.1
1.9.1

Event History

May 12, 2023
Advisory Published
08:19 PM
Jun 8, 2023
CVE Published
via MITRE·08:27 PM
Data Sourced
via MITRE·08:27 PM
DescriptionWeakness
Jun 23, 2023
Data Sourced
via Red Hat·11:59 AM
DescriptionSeverityAffected Software
Apr 3, 58187
Event
08:45 PM

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

What is CVE-2023-29401?

CVE-2023-29401 is a vulnerability in the Gin-Gonic Gin web framework that could allow a remote attacker to bypass security restrictions.

2

How does CVE-2023-29401 work?

The vulnerability occurs due to the filename parameter of the Context.FileAttachment function not being properly sanitized, allowing a maliciously crafted filename to modify the Content-Disposition header.

3

What is the severity of CVE-2023-29401?

The severity of CVE-2023-29401 is high with a CVSS score of 7.5.

4

Which software versions are affected by CVE-2023-29401?

The affected software versions include Gin-Gonic Gin versions between 1.3.1 and 1.9.1, golang-github-gin-gonic-gin version 1.9.1, and github.com/gin-gonic/gin versions between 1.3.1 and 1.9.1.

5

How can I fix CVE-2023-29401?

To fix CVE-2023-29401, update the Gin-Gonic Gin web framework to version 1.9.1 or higher.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203