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

CoTURN HTTP Server POST-parsing information leak vulnerability

The CoTURN web server's POST body parser skips leading carriage-return and newline bytes without reducing the recorded length, so a later copy reads past the end of the buffer. An attacker sending a crafted HTTPS POST could leak memory contents or cause other misbehaviour.

Aleksandar Nikolic Follow

Originally disclosed on Cisco Talos

High 7.0 View original

An exploitable heap out-of-bounds read vulnerability exists in the way CoTURN 4.5.1.1 web server parses POST requests. A specially crafted HTTP POST request can lead to information leaks and other misbehavior.

Aleksandar Nikolic, on Cisco Talos

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 parser advances the data pointer past leading CR/LF bytes without decrementing data_len, so a subsequent memcpy copies more bytes than remain in the buffer.

Impact

Depending on memory layout, this could leak sensitive information from other requests, cause further memory corruption, or crash the service.

What the attacker needed

Network access to the admin web server; crafted POST request

The fix

The vendor patched the issue, presumably by decrementing the length as the pointer is advanced.

How it was found

  1. Send an HTTPS POST request to the administrative web server's logon path.
  2. Set the Content-Length header to a value that controls the allocation size.
  3. Fill the body with many carriage-return bytes so the skip loop advances to the end of the buffer.
  4. The copy then reads beyond the buffer, leaking memory or causing misbehaviour.

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.

The server reads the body of a web request into a fixed-size area of memory. When it trims blank lines at the start, it moves its reading position forward but forgets to shrink the length it later copies, so it copies more bytes than exist and reads whatever sits next to that memory. That stray data can include secrets from other requests, or crash the service.

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 Aleksandar Nikolic

View all

147 more disclosed reports, best first.

More from Cisco Talos

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.