T09 · Insecure Skill Coding Practices
- Location
scripts/lock:78- Finding
Unlock Operation Does Not Require an Explicit Device Name or Confirmation
- Content
View full analysis
(d.nickname || '').trim()).join(', ')); } const s = query.toLowerCase().trim(); const hits = list.filter(d => (d.nickname || '').toLowerCase().includes(s)); if (!hits.length) die('no lock matching "' + query + '". Try: status'); if (hits.length > 1) die('"' + query + '" matches ' + hits.length + ' locks: ' + hits.map(d => (d.nickname || '').trim()).join(', ')); return hits[0]; } ``` ```javascript if (cmd === 'lock' || cmd === 'unlock') { const lock = await pick(rest[0]); const name = (lock.nickname || '').trim(); if (cmd === 'lock') await w.lockDoor(lock); else await w.unlockDoor(lock); } ``` ### Technical Analysis The `unlock` command passes `rest[0]` to `pick()` without verifying that the caller supplied a non-empty lock name. When the associated Wyze account contains exactly one lock, `pick()` automatically returns that lock if the query is absent. Consequently, the following command can trigger an unlock operation without naming the target: ```bash node scripts/lock unlock ``` The implementation also has no confirmation flag, confirmation token, or other programmatic authorization checkpoint before invoking `unlockDoor()`. This contradicts the documented safety requirement that an unlock request identify a single named lock and receive explicit user confirmation. Although automatic selection may be convenient for read-only status operations, it is unsafe for a security-sensitive operation that changes physical access controls. Safety enforcement is delegated entirely to the calling ...[truncated 1232 chars]- Remediation
View remediation
