Advisory Database
  • Advisories
  • Dependency Scanning
  1. golang
  2. ›
  3. github.com/imroc/req/v2
  4. ›
  5. CVE-2024-45258

CVE-2024-45258: req may send an unintended request when a malformed URL is provided

August 26, 2024 (updated November 18, 2024)

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

  • github.com/advisories/GHSA-cj55-gc7m-wvcq
  • github.com/imroc/req
  • github.com/imroc/req/commit/04e3ece5b380ecad9da3551c449f1b8a9aa76d3d
  • github.com/imroc/req/compare/v3.43.3...v3.43.4
  • nvd.nist.gov/vuln/detail/CVE-2024-45258
  • pkg.go.dev/vuln/GO-2024-3098

Code Behaviors & Features

Detect and mitigate CVE-2024-45258 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 3.43.4

Fixed versions

  • 3.43.4

Solution

Upgrade to version 3.43.4 or above.

Impact 9.8 CRITICAL

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-20: Improper Input Validation
  • CWE-918: Server-Side Request Forgery (SSRF)
  • CWE-94: Improper Control of Generation of Code ('Code Injection')

Source file

go/github.com/imroc/req/v2/CVE-2024-45258.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:51 +0000.