Skip to content
Race condition Advisory Advanced CVE-2021-21902

Garrett Metal Detectors iC Module CMA run_server_6877 authentication bypass vulnerability

An authentication bypass in the Garrett iC Module's CLI server allows an attacker to hijack a session by racing a new connection between a legitimate user's connection and password submission. The attacker gains authenticated CLI access without knowing the password.

Matt Wiseman Follow

Originally disclosed on Cisco Talos

High 7.5 View original

An authentication bypass vulnerability exists in the CMA runserver6877 functionality of Garrett Metal Detectors iC Module CMA Version 5.0. A properly-timed network connection can lead to authentication bypass via session hijacking.

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

Likely a race condition where the server uses a global 'new_socket' variable instead of the specific client's socket when creating an authenticated session, allowing an attacker's connection to be associated with a legitimate user's successful authentication.

Impact

An attacker could gain authenticated CLI access to the device, allowing them to read statistics and change configurations, but the attack requires precise timing and a legitimate user attempting to log in.

What the attacker needed

Network access to TCP port 6877; a legitimate user connects and authenticates; attacker connects within a short window (~0.5s)

The fix

The vendor patched the vulnerability, likely by correcting the socket handling to use the authenticated client's socket instead of a global variable.

How it was found

  1. A legitimate user connects to TCP port 6877 of the device.
  2. Before the user submits their password, the attacker opens a connection to the same port.
  3. The user submits a valid password, triggering authentication.
  4. The server incorrectly associates the attacker's socket with the authenticated session.
  5. The attacker now has authenticated CLI access without knowing the password.

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.

When a user logs in, the device briefly mixes up which network connection belongs to whom. An attacker who connects at just the right moment can take over the logged-in session and control the metal detector without needing the password.

What is Race condition?

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.

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.

Race conditions

The lesson behind this report.

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.