Garrett Metal Detectors iC Module CMA check_udp_crc strcpy stack-based buffer overflow vulnerability
The CRC validation routine in the iC Module's UDP discovery service copies the text after the last semicolon into a fixed 8-byte stack buffer without any length check. An attacker who sends a crafted UDP packet with an oversized CRC field can overflow the stack and take control of the program counter.
Originally disclosed on Cisco Talos
A stack-based buffer overflow vulnerability exists in the CMA checkudpcrc function of Garrett Metal Detectors’ iC Module CMA Version 5.0. A specially-crafted packet can lead to a stack-based buffer overflow during a call to strcpy.
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 locates the CRC field after the last semicolon and copies it with an unbounded strcpy into an 8-byte stack buffer, with no check that the field fits.
Impact
A remote, unauthenticated attacker could crash the service or execute arbitrary code on the module, giving full control of confidentiality, integrity and availability.
What the attacker needed
Network access to UDP port 6877; no authentication required
The fix
The vendor patched the issue; the copy should be bounded so the CRC field cannot exceed the 8-byte buffer.
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 listens for small network messages on a UDP port and reads the last part of each message as a checksum. It copies that part into a tiny fixed-size space on the stack without checking how long it is, so a long value spills over into neighbouring memory. Because the spilled data can overwrite the address the processor returns to, an attacker can redirect execution to code of their choosing.
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.