Skip to content
Memory corruption Advisory Advanced CVE-2020-13398

GHSL-2020-102: Heap overflow in FreeRDP crypto_rsa_common - CVE-2020-13398

A heap overflow in FreeRDP's crypto_rsa_common function occurs because the size of a memory copy is controlled by one variable while the buffer allocation is controlled by another, allowing an attacker to trigger an out-of-bounds write. This could lead to remote code execution.

antonio-morales Follow

Originally disclosed on GitHub Security Lab

An out-of-bounds (OOB) write vulnerability has been detected in FreeRDP’s cryptorsacommon (heap overflow).

antonio-morales, 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 code uses separate variables for the copy length and the buffer allocation size, and the allocation size can be made smaller than the copy length due to insufficient validation.

Impact

This issue may lead to remote heap overflow and potentially Remote Code Execution (RCE).

What the attacker needed

Attacker controls server-side RSA public key

The fix

The bug was fixed by the vendor.

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.

A heap overflow is a bug where a program writes more data into a memory buffer than it was allocated to hold, corrupting nearby memory. In this case, the amount of data copied is set by one value, but the buffer size is set by a different value that an attacker can influence, so the copy can overflow the buffer. This can crash the program or let an attacker run their own code.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

More by antonio-morales

View all

45 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.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.