Researchers disclosed two vulnerabilities in the .NET libraries RestSharp and Refit that allowed CRLF header injection and HTTP request splitting through unsafe use of HttpHeaders.TryAddWithoutValidation. The issues, tracked as CVE-2024-45302 and CVE-2024-51501, affected APIs that accepted attacker-controlled header values, including RestSharp methods such as AddHeader, AddOrUpdateHeader, and AddDefaultHeader, as well as Refit's [Header] and [Authorize] attributes. Proof-of-concept testing showed that injected \r\n sequences could append unintended headers or create a second HTTP/1.1 request, with Apache logs capturing unexpected requests to /secret endpoints.
Microsoft's documentation for TryAddWithoutValidation states that the method validates header names but does not validate header values, and warns that untrusted input containing newline characters can cause application misbehavior and enable request smuggling-style attacks. The guidance recommends rejecting at least \r, \n, and \0 before using the API. Both library maintainers accepted the reports and released fixes after disclosure, while the researcher said large-scale searches across GitHub and NuGet found many uses of the method but only these two libraries produced confirmed exploitable cases.

Mallory correlates global threat intelligence with your attack surface — know if you’re exposed before adversaries strike.
6 events from the most recent confirmed update back to the earliest known activity.
Microsoft's .NET documentation warned that HttpHeaders.TryAddWithoutValidation must not be used with untrusted values because malformed input, especially CR, LF, and null characters, can enable issues such as request smuggling. The guidance recommends validating inputs and rejecting those characters at minimum.
Binary Security published research detailing CRLF header injection and HTTP request splitting vulnerabilities in RestSharp and Refit, including proof-of-concept exploits and affected APIs. The disclosure states there was no confirmation of real-world exploitation or vulnerable downstream applications.
In January 2025, the researcher searched GitHub for public .cs files using TryAddWithoutValidation and found 10,368 hits, ultimately identifying 4,241 unique repositories after working around API result limits. The broader review, combined with decompiling about 5,000 public NuGet packages, produced only two interesting vulnerable libraries among 171 checked items.
In August 2024, the researcher reported CRLF header injection and request splitting issues affecting the RestSharp and Refit .NET libraries. The issues were later assigned CVE-2024-45302 for RestSharp and CVE-2024-51501 for Refit.
After accepting the August 2024 reports, RestSharp and Refit released fixes for the vulnerabilities in their libraries. The source does not provide a more specific date for the releases.
Binary Security's research began after observing that .NET's HttpHeaders.TryAddWithoutValidation validates header names but not header values, enabling CRLF-based header injection and HTTP/1.1 request splitting. The researcher demonstrated the behavior with a basic .NET HttpClient proof of concept and confirmed injected requests in Apache logs.
Vulnerabilities, threat actors, malware, products, organizations, and breaches Mallory has linked to this story.
2 references tracked. Mallory keeps watching after this page renders.
Map indicators from this story to your assets and identify affected systems in minutes.
Every observed campaign, victim, and pivot linked to actors named in this story.
Malware, exploits, and IOCs connected to the activity described here.
YARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.
Get matching new stories delivered to your team as they break — not the next morning.
Ask questions about this story and take action on the answers.