CVE-2024-45302
Restsharp
CVE-2024-45302 is a CRLF injection vulnerability in RestSharp, a .NET REST and HTTP API client. This flaw allows attackers to inject arbitrary HTTP headers or smuggle HTTP requests by manipulating the header value in methods like RestRequest.AddHeader
.
The vulnerability arises because HttpHeaders.TryAddWithoutValidation
doesn't validate for CRLF characters. Although the CVSS score is 7.8, the SOCRadar Vulnerability Risk Score (SVRS) of 30 indicates lower real-world exploitability compared to purely quantitative metrics. While the risk is lower, applications passing user-controlled values to headers are still vulnerable. Exploitation could lead to Server Side Request Forgery (SSRF). RestSharp version 112.0.0 addresses this issue; users should upgrade.
Description
CVE-2024-45302 affects RestSharp, a popular .NET library for REST and HTTP API communication. The vulnerability stems from a flaw in how RestSharp handles HTTP header values. The RestRequest.AddHeader
, RestRequest.AddOrUpdateHeader
, and RestClient.AddDefaultHeader
methods allow an attacker to inject CRLF (carriage return, line feed) characters into header values. This can lead to CRLF injection, potentially enabling request splitting and Server Side Request Forgery (SSRF) attacks. The vulnerability is classified as a potential vulnerability in applications using RestSharp and not in RestSharp itself. While RestSharp has addressed this issue in version 112.0.0, applications using older versions remain vulnerable.
SVRS Score: 30, which while not categorized as critical, still signifies a moderate risk requiring attention.
Key Insights
- CRLF Injection: The vulnerability enables attackers to inject CRLF characters into HTTP headers. These characters can manipulate how the server interprets the header values, leading to malicious actions.
- Request Splitting: CRLF injection can be used for request splitting attacks, where attackers can insert additional HTTP requests into the original request, potentially bypassing security measures and executing unauthorized actions.
- Server-Side Request Forgery (SSRF): This vulnerability can be exploited for SSRF attacks, where attackers can send requests to internal systems or services on behalf of the vulnerable application. This could allow attackers to access sensitive data or perform unauthorized actions within the target network.
Mitigation Strategies
- Upgrade RestSharp: Immediately upgrade to RestSharp version 112.0.0 or later to patch the vulnerability.
- Input Validation: Implement strict input validation for all user-provided data, especially when it's used to construct HTTP headers. Ensure that CRLF characters are explicitly removed or escaped before processing.
- Web Application Firewall (WAF): Consider using a WAF to detect and block malicious requests that exploit CRLF injection or request splitting techniques.
- Security Awareness Training: Educate development teams about the potential risks of CRLF injection and the importance of secure coding practices, including proper input validation and data sanitization.
Additional Information
If you have any further questions or require additional information on this incident, please use the "Ask to Analyst" feature, contact SOCRadar directly, or open a support ticket.
Indicators of Compromise
Exploits
News
Social Media
Affected Software
References
CWE Details
CVE Radar
Real-time CVE Intelligence & Vulnerability Management Platform
CVE Radar provides comprehensive vulnerability intelligence by monitoring CVE databases, security advisories, and threat feeds. Get instant updates on new vulnerabilities, exploit details, and mitigation strategies specific to your assets.