{"id":"GHSA-hhjv-jq77-cmvx","aliases":["GHSA-hhjv-jq77-cmvx"],"related":[],"kind":"vulnerability","state":"published","title":"zeptoclaw has Android device shell blocklist bypass via argument permutation","summary":"### Summary\n[zeptoclaw](https://github.com/qhkm/zeptoclaw) implements a [blocklist](https://github.com/qhkm/zeptoclaw/blob/fe2ef07cfec5bb46b42cdd65f52b9230c03e9270/src/tools/android/actions.rs#L413-L424) to prevent dangerous commands running in android device shell, but this blocklist has several blocked commands with argements in the pattern literal, such as `rm -f` and `rm -rf`, this can be simply bypassed by using different orders for these arguments, such as `rm -r -f` or `rm -fr` etc.\n\n### Details\nAs in code [src/tools/android/actions.rs#L413-L424](https://github.com/qhkm/zeptoclaw/blob/fe2ef07cfec5bb46b42cdd65f52b9230c03e9270/src/tools/android/actions.rs#L413-L424), we can see the `rm -f` and `rm -rf` are hard coded and thus can be simply bypassed via `rm -r -f` or `rm -fr` etc.\n```rust\npub async fn device_shell(adb: &AdbExecutor, cmd: &str) -> Result<String> {\n    // Normalize whitespace for blocklist check\n    let normalized: String = cmd.split_whitespace().collect::<Vec<_>>().join(\" \");\n    let lower = normalized.to_lowercase();\n\n    let blocked = [\n        \"rm -rf\",\n        \"rm -r\",\n        \"reboot\",\n        \"factory_reset\",\n        \"wipe\",\n        \"format\",\n        \"dd if=\",\n        \"mkfs\",\n        \"flash\",\n        \"fastboot\",\n    ];\n    for pattern in &blocked {\n        if lower.contains(pattern) {\n            return Err(ZeptoError::Tool(format!(\n                \"Blocked dangerous command containing '{}'\",\n                pattern\n            )));\n        }\n    }\n```\n\n### PoC\nSet up [zeptoclaw](https://github.com/qhkm/zeptoclaw) with an Android tool and then run the command `rm -f -r` etc.\n\n### Impact\nUnauthorized command executed in Android device.\n\n### Credit\n[@zpbrent](https://github.com/zpbrent)","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"### Summary\n[zeptoclaw](https://github.com/qhkm/zeptoclaw) implements a [blocklist](https://github.com/qhkm/zeptoclaw/blob/fe2ef07cfec5bb46b42cdd65f52b9230c03e9270/src/tools/android/actions.rs#L413-L424) to prevent dangerous commands running in android device shell, but this blocklist has several blocked commands with argements in the pattern literal, such as `rm -f` and `rm -rf`, this can be simply bypassed by using different orders for these arguments, such as `rm -r -f` or `rm -fr` etc.\n\n### Details\nAs in code [src/tools/android/actions.rs#L413-L424](https://github.com/qhkm/zeptoclaw/blob/fe2ef07cfec5bb46b42cdd65f52b9230c03e9270/src/tools/android/actions.rs#L413-L424), we can see the `rm -f` and `rm -rf` are hard coded and thus can be simply bypassed via `rm -r -f` or `rm -fr` etc.\n```rust\npub async fn device_shell(adb: &AdbExecutor, cmd: &str) -> Result<String> {\n    // Normalize whitespace for blocklist check\n    let normalized: String = cmd.split_whitespace().collect::<Vec<_>>().join(\" \");\n    let lower = normalized.to_lowercase();\n\n    let blocked = [\n        \"rm -rf\",\n        \"rm -r\",\n        \"reboot\",\n        \"factory_reset\",\n        \"wipe\",\n        \"format\",\n        \"dd if=\",\n        \"mkfs\",\n        \"flash\",\n        \"fastboot\",\n    ];\n    for pattern in &blocked {\n        if lower.contains(pattern) {\n            return Err(ZeptoError::Tool(format!(\n                \"Blocked dangerous command containing '{}'\",\n                pattern\n            )));\n        }\n    }\n```\n\n### PoC\nSet up [zeptoclaw](https://github.com/qhkm/zeptoclaw) with an Android tool and then run the command `rm -f -r` etc.\n\n### Impact\nUnauthorized command executed in Android device.\n\n### Credit\n[@zpbrent](https://github.com/zpbrent)","format":"markdown","source":"ghsa"}],"published":"2026-03-05T00:35:29.000Z","modified":"2026-03-05T00:47:28.257Z","severity":{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-78"],"affected":[{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.6.2"}],"ecosystem":"crates.io","package":"zeptoclaw","purl":"pkg:cargo/zeptoclaw","source":"ghsa"}],"references":[{"url":"https://github.com/qhkm/zeptoclaw/security/advisories/GHSA-hhjv-jq77-cmvx","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/qhkm/zeptoclaw/commit/68916c3e4f3af107f11940b27854fc7ef517058b","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/qhkm/zeptoclaw","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/qhkm/zeptoclaw/blob/fe2ef07cfec5bb46b42cdd65f52b9230c03e9270/src/tools/android/actions.rs#L413-L424","tags":["web"],"sources":["ghsa"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-hhjv-jq77-cmvx","url":"https://github.com/advisories/GHSA-hhjv-jq77-cmvx","licence":"CC-BY-4.0","modified":"2026-03-05T00:47:28.257Z"}],"updatedAt":"2026-11-25T22:56:42.586Z"}