Skip to content
Memory corruption Advisory Advanced CVE-2021-21748

ZTE MF971R ADB_MODE_SWITCH stack-based buffer overflow vulnerability

A stack-based buffer overflow exists in the ADB_MODE_SWITCH API of the ZTE MF971R router because the password parameter is not length-checked before being converted from hex to binary. An attacker could trick a victim into visiting a malicious URL to trigger the overflow and potentially achieve remote code execution.

Marcin 'Icewall' Noga Follow

Originally disclosed on Cisco Talos

Critical 9.6 View original

An exploitable Stack Based Buffer Overflow vulnerability exists in ZTE MF971R LTE router version wainnerversion:BDPLKPLMF971R1V1.0.0B06. A specially-crafted HTTP request can cause a stack-based buffer overflow which can lead to remote code execution.

Marcin 'Icewall' Noga, 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 my_string_to_hex function copies converted bytes into a fixed-size stack buffer without checking that the input length fits, causing a stack-based buffer overflow.

Impact

A remote, unauthenticated attacker could overwrite the return address and potentially achieve arbitrary remote code execution, though the victim must visit a malicious URL.

What the attacker needed

Victim visits a malicious URL; attacker can bypass referer check; no login required

The fix

The vendor patched the vulnerability, likely by adding a length check on the password parameter before conversion.

How it was found

  1. Craft an HTTP POST request to the goform_set_cmd_process endpoint with goformId set to ADB_MODE_SWITCH.
  2. Include a password parameter containing at least 2080 characters.
  3. Set a Referer header to bypass the referer check.
  4. Send the request to the router's web interface to trigger the overflow.

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.

This router has a web interface with a function that takes a password from a form and converts it from text into binary data. The code does not check how long the password is, so a very long password overflows a fixed-size memory buffer on the stack. That can crash the router or let an attacker run their own code on it.

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 Marcin 'Icewall' Noga

View all

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