# CVE-2024-45302: CRLF Injection in RestSharp's \`RestRequest.AddHeader\` method

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 6.1
- **CVSS:** 6.1 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: None; User interaction: Required; Scope: Unchanged; Confidentiality impact: Low; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.54% (percentile 39, 2026-11-26)
- **CWE:** CWE-93
- **Aliases:** GHSA-4rr6-2v9v-wcpc
- **Published:** 2024-08-29T19:30:51.000Z
- **Modified:** 2026-06-17T07:53:59.057Z

## Who should check

- Projects that depend on NuGet package RestSharp (\>= 107.0.0-preview.1, \< 112.0.0)
- Anyone running RestSharp \>= 107, \< 112.0.0

## 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.

## Affected and fixed versions

- NuGet `RestSharp`: affected \>= 107.0.0-preview.1, \< 112.0.0; fixed 112.0.0 (osv)
- RestSharp: \>= 107, \< 112.0.0 (cvelist)

## Mitigation

- Upgrade RestSharp to 112.0.0 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-45302. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-45302.md
Affected: RestSharp >= 107.0.0-preview.1, < 112.0.0
Fixed in: 112.0.0

Steps:
1. Search this machine and project for RestSharp (NuGet), RestSharp: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-45302 being exploited?

There is no confirmed exploitation: CVE-2024-45302 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.54% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2024-45302?

Medium: CVSS 6.1 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed). A user has to take an action, such as opening a link, for the attack to work.

### Which versions are affected by CVE-2024-45302?

RestSharp \>= 107.0.0-preview.1, \< 112.0.0.

### Is there a fix for CVE-2024-45302?

Yes. Fixed in 112.0.0. Upgrade RestSharp to 112.0.0 or later.

### How do I check if I'm affected by CVE-2024-45302?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/restsharp/RestSharp/security/advisories/GHSA-4rr6-2v9v-wcpc>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2024-45302>
- patch: <https://github.com/restsharp/RestSharp/commit/0fba5e727d241b1867bd71efc912594075c2934b>
- other: <https://github.com/restsharp/RestSharp/blob/777bf194ec2d14271e7807cc704e73ec18fcaf7e/src/RestSharp/Request/HttpRequestMessageExtensions.cs#L32>
- other: <https://github.com/restsharp/RestSharp>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-45302>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-4rr6-2v9v-wcpc> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2024-45302> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-45302>
