Skip to content
RCE Advisory Intermediate CVE-2020-27998

GHSL-2020-143: Arbitrary Code Execution in FastReports - CVE-2020-27998

FastReports compiles user-supplied expressions from report templates into .NET code, allowing any user to execute arbitrary code on the server. An attacker could run system commands or read files by entering a crafted expression and previewing the report.

jarlob Follow

Originally disclosed on GitHub Security Lab

FastReports is vulnerable to arbitrary code execution because it compiles and runs C# code from a report template.

jarlob, on GitHub Security Lab

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The application compiles user-supplied expressions into a .NET assembly without restricting what the code can do or running it in a sandbox.

Impact

Arbitrary code execution on the report template processing host.

What the attacker needed

Access to the report designer; ability to create or edit expressions

The fix

The vendor implemented filtering to restrict allowed expressions, and the report recommends running compiled code in a sandboxed process.

How it was found

  1. Create a new expression or edit an existing one in the report designer.
  2. Enter an expression that calls arbitrary .NET methods.
  3. Click Preview to execute the expression on the server.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

FastReports is a tool for building reports. It takes expressions that users type and turns them into real code that runs on the server. Because there is no check on what those expressions can do, a user can make the server run any command they want, like listing files on the server's hard drive.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by jarlob

View all

192 more disclosed reports, best first.

More from GitHub Security Lab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.