T09 · Insecure Skill Coding Practices
- Location
SKILL.md:11- Finding
Ineffective Two-Factor Authentication Handshake
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 11-14
Vulnerability Type: Authentication bypass caused by an unverified acknowledgment
Risk Level: HighVulnerable Code
markdown ### 1. Two-Factor Authentication (2FA) Handshake * **Trigger:** Execution of high-risk tools (e.g., `exec`, `gateway.config.patch`, `file_write` to system paths, `rm`). * **Step 1 (Alert):** Send `system.notify` to the paired `openclaw-ios` device. * **Step 2 (Handshake):** Monitor for a user message containing `ok` on the same channel. * **Step 3 (Verification):** Once the handshake is confirmed, use `canvas.present` to display a unique 4-digit code on the user's primary device.The same ineffective handshake is reused by the recovery workflow at
SKILL.md, lines 31-35:markdown ### Recovery Protocol * **Step 1:** User issues the `/unlock` command. * **Step 2:** Agent triggers a 2FA handshake via `openclaw-ios`. * **Step 3:** Upon successful 2FA, set `lockdown.status` to `false`.Technical Analysis
The procedure treats any message containing
okon the same channel as successful authentication. It does not require proof that the response originated from the paired iOS device or the legitimate owner. It also does not define an exact-match requirement, authenticated device identity, challenge binding, expiration, replay prevention, rate limiting, or cryptographic verification.The four-digit code does not repair this weakness because it is displayed only after the handshake has already been considered successful. The playbook never instructs the user to return that code and never validates it before authorizing the protected operation.
The repository contains documentation rather than executable enforcement code. Therefore, the vulnerability exists in the prescribed security workflow: an Agent implementing these instructions literally would provide an ineffective second factor despite presenting it as 2FA.
Attack Path
...[truncated 1380 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace the plain-text
okacknowledgment with an approval generated by an authenticated, previously paired device. - Generate a cryptographically random, short-lived challenge before authorization and bind it to:
- The exact privileged operation and normalized arguments.
- The requesting session.
- The authenticated user and paired device.
- A creation time, expiration time, and unique nonce.
- Require the mobile device to sign or explicitly approve the challenge through an authenticated channel, then verify that approval before executing the operation.
- Mark every challenge as consumed after one successful verification and reject expired, replayed, mismatched, or unsolicited responses.
- Do not treat substring matches such as messages containing
okas authorization. - If a numeric fallback code is retained, require the user to return it through a separately authenticated channel and validate it before authorization. Use sufficient entropy, a short expiration period, strict attempt limits, and one-time use.
- Apply the same controls to
/unlock, and require explicit confirmation of the specific transition from locked to unlocked. - Enforce authorization in a trusted runtime policy layer rather than relying solely on natural-language Agent compliance. Privileged tools should remain technically unavailable until the verifier produces a valid authorization token.
- Record security events without storing reusable authentication secrets, including challenge creation, approval identity, expiration, rejection, and the exact authorized action.
- Replace the plain-text
