CVE-2021-46703 Code injection in RazorEngine
Attackers can execute arbitrary .NET code via controlled template contents in the unsupported IsolatedRazorEngine component.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- None listed
What is CVE-2021-46703?
CVE-2021-46703 is a critical code injection vulnerability in n/a, published on 6 Mar 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
In the IsolatedRazorEngine component of Antaris RazorEngine through 4.5.1-alpha001, an attacker can execute arbitrary .NET code in a sandboxed environment (if users can externally control template contents). NOTE: This vulnerability only affects products that are no longer supported by the maintainer
Which versions are affected by CVE-2021-46703?
2 open source packages ship an affected version, including RazorEngine. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
RazorEngine NuGet | All versions to 4.5.1-alpha001 | None |
RazorEngine NuGet | All versions to 4.5.1-alpha001 | None |
Products include Razorengine Project Razorengine.
How do I fix CVE-2021-46703?
No fix has been published for CVE-2021-46703 yet. Limit exposure of the affected software until one is available.
Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.
Is CVE-2021-46703 being exploited?
There is no known exploitation of CVE-2021-46703 in the wild and no public exploit code.
Public exploit code: 1 proofs of concept on GitHub.
Sources
Also known as GHSA-ph3v-2hq5-5qfq.