{"answers":{"affected":"2 open source packages ship an affected version, including RestSharp. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-45302 exists.","fix":"Upgrade RestSharp to 112.0.0 or later.","what":"CVE-2024-45302 is a medium-severity server-side request forgery vulnerability in RestSharp, published on 29 Aug 2024. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2024-45302 and fix it if it is affected.\n\nWhat it is: CVE-2024-45302 is a medium-severity server-side request forgery vulnerability in RestSharp, published on 29 Aug 2024. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-45302 exists.\n\nAffected packages and fixed versions:\n- RestSharp (NuGet): affected from 107.0.0-preview.1; fixed in 112.0.0\n- RestSharp (NuGet): affected from 107.0.0-preview.1; fixed in 112.0.0\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2024-45302/ (Markdown: https://insights.sbomify.com/CVE-2024-45302/index.md)","id":"CVE-2024-45302","markdown":"https://insights.sbomify.com/CVE-2024-45302/index.md","name":"CVE-2024-45302","record":{"aliases":["GHSA-4rr6-2v9v-wcpc"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["security_bypass","data_read"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"REST client library","requires_auth":"none","summary":"CRLF injection in RestSharp allows attackers to inject headers or split requests, potentially leading to Server-Side Request Forgery in consuming applications.","user_interaction":"required","vuln_class":"ssrf"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"restsharp","vendor":"restsharp"}],"cvss":{"score":6.1,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:H","version":"3.1"},"cwes":[{"id":"CWE-74","name":"Improper Neutralization of Special Elements in Output Used by a Downstream Component"},{"id":"CWE-93","name":"Improper Neutralization of CRLF Sequences"}],"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.","ecosystems":["NuGet"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"CRLF Injection in RestSharp's `RestRequest.AddHeader` method","id":"CVE-2024-45302","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"NuGet","product":null,"products":[],"type":"ssrf","year":"2024"},"n_packages":2,"n_references":3,"next":{"headline":"Discourse Calendar plugin event names susceptible to XSS","id":"CVE-2024-45303"},"packages":[{"ecosystem":"NuGet","fixed":["112.0.0"],"introduced":["107.0.0-preview.1"],"last_affected":[],"package":"RestSharp","purl":null,"source":"GHSA-4rr6-2v9v-wcpc"},{"ecosystem":"NuGet","fixed":["112.0.0"],"introduced":["107.0.0-preview.1"],"last_affected":[],"package":"RestSharp","purl":"pkg:nuget/RestSharp","source":"GHSA-4rr6-2v9v-wcpc"}],"prev":{"headline":"ZDI-CAN-24744: Mintty Path Conversion Improper Input Validation Information Disclosure Vulnerability","id":"CVE-2024-45301"},"products":["RestSharp"],"published":"2024-08-29","related":[{"cvss_score":7.5,"headline":"Incorrect Regular Expression in RestSharp","id":"CVE-2021-27293","kev_date_added":null,"published":"2021-07-12"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"poc","technical_impact":"partial"},"state":"PUBLISHED","updated":"2024-08-30","vendors":["restsharp"]},"summary":"CRLF injection in RestSharp allows attackers to inject headers or split requests, potentially leading to Server-Side Request Forgery in consuming applications.","url":"https://insights.sbomify.com/CVE-2024-45302/"}