Garrett Metal Detectors iC Module CMA CLI setenv command directory traversal vulnerability
The setenv command in the CMA CLI concatenates a user-supplied key to a fixed directory path without validation, allowing directory traversal. An authenticated attacker can overwrite or create arbitrary files, potentially leading to code execution as root.
Originally disclosed on Cisco Talos
A directory traversal vulnerability exists in the CMA CLI setenv command of Garrett Metal Detectors’ iC Module CMA Version 5.0. A specially-crafted command line argument can lead to arbitrary file overwrite.
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 setEnv function concatenates the user-supplied key directly to a fixed path without sanitising path traversal sequences.
Impact
An authenticated attacker could overwrite or create arbitrary files, potentially leading to code execution as the root user.
What the attacker needed
Authenticated access to the CLI
The fix
The vendor patched the vulnerability, but the text does not describe the fix.
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 has a command-line interface where you can set 'environment variables'. The program takes the name you give and uses it as a filename, but it doesn't check if the name contains '../' sequences that let you escape the intended folder. So you can write files anywhere on the system, which can be abused to run your own code.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.