CVE-2020-15111: CRLF vulnerability in github.com/gofiber/fiber
Summary
CVE-2020-15111: CRLF vulnerability in Fiber in github.com/gofiber/fiber. Affects github.com/gofiber/fiber versions < 1.12.6. Fixed in 1.12.6. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The package under scrutiny is github.com/gofiber/fiber, which is a Go package that provides a lightweight web framework for building fast and efficient web applications. It offers various features such as routing, middleware support, and request/response handling. The vulnerability in this package allows for a CRLF (Carriage Return Line Feed) attack, where a maliciously crafted filename can lead to the download of a file with an attacker-controlled filename and the injection of additional headers into an HTTP response.
Vulnerability Detail
The CRLF vulnerability in github.com/gofiber/fiber arises due to improper input sanitization. An attacker can exploit this vulnerability by manipulating the filename parameter in a file download request. By injecting special characters such as carriage return and line feed, the attacker can control the filename and introduce additional headers into the HTTP response. This can lead to various security risks, including the potential for content spoofing, HTTP response splitting, and cross-site scripting (XSS) attacks.
How To Fix
Latest published version: v1.14.6 as of 22 Oct 2026
go get github.com/gofiber/fiber@v1.14.6
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
1.12.6
This is the first release that contains the fix.
go get github.com/gofiber/fiber@v1.12.6
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If updating the package is not immediately feasible, a temporary workaround can be implemented by manually sanitizing the filename parameter before processing it. This can involve removing or encoding any special characters that could be used for CRLF injection. Here is an example of how the filename parameter can be sanitized using Go code:
import (
"net/http"
"strings"
)
func downloadFile(w http.ResponseWriter, r *http.Request) {
filename := sanitizeFilename(r.URL.Query().Get("filename"))
// Rest of the code for file download
}
func sanitizeFilename(filename string) string {
filename = strings.ReplaceAll(filename, "\r", "")
filename = strings.ReplaceAll(filename, "\n", "")
// Additional sanitization logic if required
return filename
}
Conclusion
The CRLF vulnerability in github.com/gofiber/fiber can be exploited by manipulating the filename parameter in a file download request. It is crucial to update the package to version 1.12.6 or later to fix this vulnerability. If immediate update is not possible, manual sanitization of the filename parameter can serve as a temporary workaround. Regularly monitoring and updating dependencies, as well as following secure coding practices, are essential for maintaining the security of web applications. For further support on vulnerability remediation, you can reach out to DevNack.com.
See every vulnerability recorded for github.com/gofiber/fiber →
FAQ
This vulnerability allows an attacker to control the filename of a downloaded file and inject additional headers into the HTTP response. This can lead to content spoofing, HTTP response splitting, and cross-site scripting (XSS) attacks.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability. Vulert analyzes your Gopkg.lock file and provides real-time alerts for open-source vulnerabilities in your software.
Yes, a patch is available for this vulnerability. It is recommended to update the github.com/gofiber/fiber package to version 1.12.6 or later to fix the vulnerability.
There are no known exploits for this vulnerability at the moment. However, it is important to patch the vulnerability as soon as possible to prevent any potential attacks.
In addition to updating the package to the patched version, it is recommended to follow secure coding practices and input validation techniques to prevent similar vulnerabilities. Regularly monitoring and updating your application's dependencies can also help mitigate the risk of known vulnerabilities.
References
Related vulnerabilities
Recent vulnerabilities recorded for github.com/gofiber/fiber.