CVE-2021-46703 Code injection in RazorEngine

Critical 9.8 Published Updated

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.

PackageAffectedFixed in
RazorEngine NuGetAll versions to 4.5.1-alpha001None
RazorEngine NuGetAll versions to 4.5.1-alpha001None

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.

Is CVE-2021-46703 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free