CVE-2024-45302

Source
https://nvd.nist.gov/vuln/detail/CVE-2024-45302
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-45302.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2024-45302
Aliases
Published
2024-08-29T22:15:05Z
Modified
2024-10-08T04:12:22.330993Z
Severity
  • 7.8 (High) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H CVSS Calculator
Summary
[none]
Details

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.

References

Affected packages

Git / github.com/restsharp/restsharp

Affected ranges

Type
GIT
Repo
https://github.com/restsharp/restsharp
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Fixed

Affected versions

103.*

103.2
103.3
103.4

104.*

104.0
104.1
104.2
104.3.3
104.4.0
104.5.0

105.*

105.0
105.0.1
105.1.0
105.2.1
105.2.2
105.2.3

106.*

106.0.0
106.0.1
106.1.0
106.10.0
106.10.1
106.11.0
106.11.1
106.11.2
106.11.3
106.11.4
106.11.5
106.11.6
106.11.7
106.12
106.12.0
106.13.0
106.14.0
106.15.0
106.2
106.2.1
106.2.2
106.3
106.3.1
106.6.10
106.6.7
106.6.8
106.7
106.7.0
106.8.9
106.9.0

107.*

107.0.0
107.0.0-preview
107.0.1
107.0.2
107.0.3
107.1.0
107.1.1
107.1.2
107.2.0
107.2.1
107.3.0

108.*

108.0.0
108.0.1
108.0.2
108.0.3

109.*

109.0.0
109.0.0-preview.1
109.0.0-preview.2
109.0.1

110.*

110.0.0
110.1.0
110.2.0

111.*

111.0.0
111.1.0
111.2.0
111.3.0
111.4.0
111.4.1

Other

legacy

v102.*

v102.6
v102.7

v103.*

v103.0
v103.1