| Title | 360 (Qihoo 360) 360 Smart Camera (IPC) 6.0.24 ~ 6.4.9 Improper Verification of Cryptographic Signature |
|---|
| Description | # 360 Smart Camera (IPC) — OTA Firmware Signature Verification Bypass
| | |
|---|---|
| **Vendor** | 360 (Qihoo 360) |
| **Product** | 360 Smart Camera (IPC) |
| **Component** | `fs2/bin/iscm` — `verify_sign` / `upgrade_thread` |
| **Affected versions** | 6.0.24 ~ 6.4.9 (incl. latest firmware) |
| **Fixed version** | None |
| **Affected models** | D621-2, D603-2, D600-2, D619, D606-6, D706 (MIPS / Ingenic JZ series) |
| **CWE** | CWE-347 Improper Verification of Cryptographic Signature |
| **CVSS 3.1** | 7.5 — `AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H` |
## Summary
`verify_sign()` returns `0` — which the caller interprets as "signature valid" —
whenever the signature string is **empty**. In the cloud/App push command
`firmwareUpgrade`, the handler performs only an **existence** check on the `sign`
JSON key. Supplying `"sign": ""` (present but empty) passes that check, reaches
`verify_sign`, and the function returns 0. An **unsigned** firmware image is then
accepted and written to flash; the device reboots into it.
## Root Cause
```
verify_sign(path, md5_expected, sign) /* 6.3.2 @0x44768c / 6.4.9 @0x450d50 */
if (sign[0] == '\0') return 0; /* empty == "verified" <-- flaw */
... base64 decode -> RSA public decrypt -> md5/sha384 compare ...
```
Caller side (push command `firmwareUpgrade`):
```
json_object_object_get(obj, "sign") -> non-NULL if key present
beqz -> continue /* checks existence only, not content */
strncpy(info+3072, sign_str, 1024) /* empty string copied */
fwrite(info, 1, 4096, "/tmp/upgrade.info")
system("killall -9 iscm") /* restart triggers check_upgrade() */
```
After reboot, `check_upgrade()` reads `/tmp/upgrade.info`, downloads the image from
the attacker-supplied URL, calls `verify_sign(...)`, and on success runs
`system("burn_helper /tmp/FIRMWARE.bin &")` followed by `reboot()`.
## Attack Chain
1. Push `firmwareUpgrade` with `"sign": ""` → passes existence check
2. `/tmp/upgrade.info` written → `iscm` restarts → `check_upgrade()` fires
3. Image downloaded from attacker URL; md5 matched (md5 is attacker-computed, not a control)
4. `verify_sign()` returns 0 → **accepted**
5. `burn_helper` writes the image to MTD flash
6. Device reboots → attacker image runs → **persistent root code execution**
## Proof of Concept
Structure of the 4096-byte upgrade-info file (the file the `firmwareUpgrade` push command writes to disk):
```
offset +0 : url = http://<host>/unsigned.bin
offset +1024 : url2 = (empty)
offset +2048 : versionName = 9.9.9
offset +2560 : md5 = <md5 of the unsigned image> # attacker-computed
offset +3072 : sign = "" # <-- empty: bypass
```
Observed behavior:
- `verify_sign(path, md5, "")` -> returns `0` (treated as "valid")
- `verify_sign(path, md5, "INVALID@SIGN!!!")` -> returns `-1` (rejected)
With an empty `sign` the unsigned image proceeds to the flash-write stage
(`before call burn_helper` appears in the log); with a non-empty invalid
signature the log shows `RSA length mismatch` and no flash write occurs.
## Evidence
- Debugger call: `verify_sign(path, md5, "")` → returns `0`; `verify_sign(path, md5, "INVALID@SIGN!!!")` → returns `-1` (control)
- End-to-end log: `Camera begin update` → download → `before/after call burn_helper`
- Control-group log (non-empty invalid signature): `RSA length mismatch`, flash write **not** reached
- Unfixed proof: `verify_sign` is instruction-identical across 6.0.24, 6.3.1, 6.3.2, 6.4.0 and 6.4.9
## Reproduction
Performed against the vendor's publicly distributed firmware in an isolated
emulation environment (no real device, no internet). A 4096-byte upgrade info
structure was built with an empty signature field and a local URL; the component
was run and the log confirmed it reached the flash-write stage.
## Fix Recommendation
1. Treat an empty or missing signature as **failure** (fail-closed).
2. Use explicit result codes rather than 0/non-zero.
3. Enforce a second signature check at the bootloader/kernel layer.
4. Support anti-downgrade.
## References
No public advisory. Full audit chain and reproduction logs available on request.
|
|---|
| Source | ⚠️ https://gist.github.com/gajgdm6-cpu/cf98af20ddb77f27a7c112214a6280f7 |
|---|
| User | xiaomao (UID 100096) |
|---|
| Submission | 10/10/2026 15:23 (2 months ago) |
|---|
| Moderation | 11/03/2026 17:23 (24 days later) |
|---|
| Status | Accepted |
|---|
| VulDB entry | 430443 [Qihoo 360 D621-2/D603-2/D600-2/D619/D606-6/D706 up to 6.4.9 Firmware Signature Verification fs2/bin/iscm verify_sign signature verification] |
|---|
| Points | 20 |
|---|