Skip to content
RCE Advisory Advanced CVE-2021-21887

Lantronix PremierWave 2050 Web Manager SslGenerateCSR stack-based buffer overflow vulnerability

The SslGenerateCSR handler in the PremierWave 2050 web manager concatenates several user-supplied CSR fields into a fixed-size stack buffer without checking length. An authenticated attacker with the ssl permission could overflow that buffer, corrupt the stack frame and gain control of the program counter, potentially leading to remote code execution.

Matt Wiseman Follow

Originally disclosed on Cisco Talos

Critical 9.1 View original

A stack-based buffer overflow vulnerability exists in the Web Manager SslGenerateCSR functionality of Lantronix PremierWave 2050 8.9.0.0R4 (in QEMU). A specially crafted HTTP request can lead to remote code execution.

Matt Wiseman, 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 handler copies user-controlled CSR fields into a fixed 1048-byte stack buffer using strcat without any length validation.

What the attacker needed

Authenticated access; ssl permission on the account; network access to the web manager

How it was found

  1. Send an authenticated HTTP POST request to the device's web manager.
  2. Include the ajax=SslGenerateCSR directive along with the certificate request fields.
  3. Supply an excessively long value in one or more of the s, l, o, ou or cn parameters.
  4. Observe the crash with the program counter overwritten by attacker-controlled bytes.

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 device's web page builds a text command by gluing together pieces of text the user types in, such as the state and city for a certificate request. It puts the result into a fixed-size space on the stack, which is a small area of memory the program uses for temporary data. Because it never checks how long the typed text is, a very long value spills over into neighbouring memory and can redirect the program to run attacker-chosen code.

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 Matt Wiseman

View all

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

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.