Skip to main content
Public proof of conceptFix available

CVE-2024-45302

A public proof of concept exists; no exploitation attested.

  • Published2024-08-29
  • Fixed in112.0.0
  • WeaknessCWE-74 · CWE-93

Am I affected?

With a domain, we read the version its public headers and pages expose. A distribution build can carry the fix under an older number.

Description

RestSharp is a Simple REST and HTTP API Client for .NET. The second argument to `RestRequest.AddHeader` (the header value) is vulnerable to CRLF injection. The same applies to `RestRequest.AddOrUpdateHeader` and `RestClient.AddDefaultHeader`. The way HTTP headers are added to a request is via the `HttpHeaders.TryAddWithoutValidation` method which does not check for CRLF characters in the header value. This means that any headers from a `RestSharp.RequestHeaders` object are added to the request in such a way that they are vulnerable to CRLF-injection. In general, CRLF-injection into a HTTP header (when using HTTP/1.1) means that one can inject additional HTTP headers or smuggle whole HTTP requests. If an application using the RestSharp library passes a user-controllable value through to a header, then that application becomes vulnerable to CRLF-injection. This is not necessarily a security issue for a command line application like the one above, but if such code were present in a web application then it becomes vulnerable to request splitting (as shown in the PoC) and thus Server Side Request Forgery. Strictly speaking this is a potential vulnerability in applications using RestSharp, not in RestSharp itself, but I would argue that at the very least there needs to be a warning about this behaviour in the RestSharp documentation. RestSharp has addressed this issue in version 112.0.0. All users are advised to upgrade. There are no known workarounds for this vulnerability.

Timeline

dates in UTC
  1. 2024-08-2922:15CVE publishedNVD

Versions per branch

NVD · CISA-ADP · OSV
Restsharp
BranchAffectedFixed in
112.0≥ 107.0.0, < 112.0.0112.0.0
112.0≥ 107, < 112.0.0112.0.0
112.0≥ 107.0.0-preview.1, < 112.0.0112.0.0

as publishedRanges as NVD and OSV publish them; a distribution’s build can be fixed under an older number.

Products declared by the CNA1 product

As GitHub_M, the CNA that assigned this CVE, declared them in the CVE record; versions as written.

  • RestSharp
    Affected
    • = >= 107, < 112.0.0no fix stated

Source: the CNA record (CVE Program), © The MITRE Corporation,CVE Terms of UseCVE recordupdated 2024-08-29

Distribution builds and vendor advisories

Packages from OSV.dev and products from the vendors' CSAF advisories.

version not verifiedVersions not verified: read as OSV.dev and the vendors publish them, not checked against each vendor's release list.

Vendor advisories

  • CVE-2024-45302 Red Hat Product Security

    restsharp: CRLF Injection in RestSharp's `RestRequest.AddHeader` method

Full record on NVD

Fix

  1. Update Restsharp to 112.0.0

Advisories and patches

Detection

Nuclei template
none so far
ProjectDiscovery
Exploit-DB
no entry
Exploit-DB
Proof of concept
Metasploit modules
none listed
Metasploit Framework

Sources

  • CISA-ADPSSVC decisionpoc2024-08-30
  • CNACVSS 3.16.1known since 2026-10-23
  • NVDCVSS 3.17.8read 2026-10-23
  • CNAweakness (CWE)CWE-93known since 2026-10-23
  • NVDweakness (CWE)CWE-74read 2026-10-23
  • FIRST EPSSEPSS score0.3 %2026-11-08
  • OSVaffected packages—
  • GitHub AdvisoriesadvisoryMODERATE2024-08-29

Identifiers

Technical details

CVSS v3 Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Published
2024-08-29
Last Modified
2026-06-17
NVD status
Analyzed
GitHub Advisory
GHSA-4rr6-2v9v-wcpc

Frequently asked questions

What is CVE-2024-45302?

RestSharp is a Simple REST and HTTP API Client for .NET. The second argument to `RestRequest.AddHeader` (the header value) is vulnerable to CRLF injection. The same applies to `RestRequest.AddOrUpdateHeader` and `RestClient.AddDefaultHeader`. The way HTTP headers are added to a request is via the `HttpHeaders.TryAddWithoutValidation` method which does not check for CRLF characters in the header value. This means that any headers from a `RestSharp.RequestHeaders` object are added to the request in such a way that they are vulnerable to CRLF-injection. In general, CRLF-injection into a HTTP header (when using HTTP/1.1) means that one can inject additional HTTP headers or smuggle whole HTTP requests. If an application using the RestSharp library passes a user-controllable value through to a header, then that application becomes vulnerable to CRLF-injection. This is not necessarily a security issue for a command line application like the one above, but if such code were present in a web application then it becomes vulnerable to request splitting (as shown in the PoC) and thus Server Side Request Forgery. Strictly speaking this is a potential vulnerability in applications using RestSharp, not in RestSharp itself, but I would argue that at the very least there needs to be a warning about this behaviour in the RestSharp documentation. RestSharp has addressed this issue in version 112.0.0. All users are advised to upgrade. There are no known workarounds for this vulnerability.

Is CVE-2024-45302 actively exploited?

A proof-of-concept exploit exists for CVE-2024-45302, but active exploitation has not been confirmed at this time.

What is the CVSS score for CVE-2024-45302?

CVE-2024-45302 has a CVSS v3 base score of 7.8 (HIGH severity), with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.

Running RestSharp? Hear about its next vulnerability

Surveillance reads the versions in your stack — a domain, a lockfile or a list — checks each CVE against the ranges its sources publish, and alerts you when one you run is exploited or enters CISA KEV. A version it cannot read stays « version not verified ».

No credit card required · No monthly cap on website lookups · 250 API requests/month

Sources for this record