Skip to content
RCE Write-up Advanced

CVE-2020-0618: RCE in SQL Server Reporting Services (SSRS)

The SSRS web application deserialised untrusted user input in the BrowserNavigationCorrector class, allowing a low-privileged authenticated user to run code on the server. An attacker with the lowest Browser role could send a crafted request to the ReportViewer page and obtain a reverse shell.

mdsec.co.uk

Published on mdsec.co.uk

Our best in class red team can deliver a holistic cyber attack simulation to provide a true evaluation of your organisation’s cyber resilience.](https://www.mdsec.co.uk/our-services/adversary-simulation/) - [{{media:1}}

Admin, on mdsec.co.uk

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 write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The OnLoad method of BrowserNavigationCorrector passed the user-controlled ViewState value to LosFormatter.Deserialize without MAC validation, so a crafted serialised object was executed.

Impact

An authenticated user with only the lowest Browser role could execute arbitrary code on the server; the text notes that WAFs can be evaded by encoding requests, so patching is the only robust defence.

What the attacker needed

An authenticated account; lowest Browser role; network access to the report server

The fix

It was fixed by Microsoft's February 2020 patch, which enabled MAC validation when using the LosFormatter class.

How it was found

  1. Send a POST request to the ReportViewer page with the navigation corrector page state set to NeedsCorrection.
  2. Include a crafted serialised ViewState value in the request body.
  3. Generate the serialised payload with ysoserial.net using the LosFormatter format.
  4. The server deserialises the value and runs the embedded command, giving a reverse shell.

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 write-up has not been written yet. The Original tab links to the source.

Deserialisation is when a program turns stored data back into live objects; if that data comes from a user and is trusted blindly, the attacker can make the program build something dangerous. Here the reporting server rebuilt an object from a hidden form field, and a crafted value led to commands running on the server. The attacker only needed a normal low-privilege login.

What is RCE?

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

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.