CVE-2024-45258: req may send an unintended request when a malformed URL is provided
The req library is a widely used HTTP library in Go. However, it does not handle malformed URLs effectively. As a result, after parsing a malformed URL, the library may send HTTP requests to unexpected destinations, potentially leading to security vulnerabilities or unintended behavior in applications relying on this library for handling HTTP requests.
Published Aug 26, 2024 · Updated Nov 18, 2024
Affected packages
github.com/imroc/req/v3
- Ecosystem
- Go
- Affected
- < 3.43.4
- Fixed in
- 3.43.4
- Check
go list -m github.com/imroc/req/v3
github.com/imroc/req
- Ecosystem
- Go
- Affected
- < 3.43.4
- Fixed in
- 3.43.4
- Check
go list -m github.com/imroc/req
github.com/imroc/req/v2
- Ecosystem
- Go
- Affected
- < 3.43.4
- Fixed in
- 3.43.4
- Check
go list -m github.com/imroc/req/v2
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
The req library is a widely used HTTP library in Go. However, it does not handle malformed URLs effectively. As a result, after parsing a malformed URL, the library may send HTTP requests to unexpected destinations, potentially leading to security vulnerabilities or unintended behavior in applications relying on this library for handling HTTP requests.
Despite developers potentially utilizing the net/url library to parse malformed URLs and implement blocklists to prevent HTTP requests to listed URLs, inconsistencies exist between how the net/url and req libraries parse URLs. These discrepancies can lead to the failure of defensive strategies, resulting in potential security threats such as Server-Side Request Forgery (SSRF) and Remote Code Execution (RCE).
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
