← Lab /AI/ML

Claude Computer-Use agents can click unintended UI elements due to TOCTOU race condition

Claude Computer-Use agents can be tricked into clicking a different button than displayed, enabling arbitrary email sending.

AI/ML Embrace The Red 25 Jun 2026 Attack Prototype evidence

Published as “Computer-Use and TOCTOU: What You Click Is Not What You Get!”

Why it matters

TOCTOU race conditions can cause AI agents to act on outdated UI, leading to unintended or malicious actions such as unauthorized email sending.

Summary

The researcher built a phishing page that swaps a benign button for a malicious one after a short delay and showed that Claude's Computer-Use agent clicks the button based on stale screenshots. By timing the page load and adding a bash prompt injection to delay the agent, the AI clicked the Outlook "Send" button instead of the intended "Continue" button, sending an arbitrary email. The attack was demonstrated in a video and reproduced reliably on the preview version of Claude Computer-Use, though Anthropic later added pixel-change checks that mitigate the issue.

What they found 2

  1. Claude Computer-Use clicked the Send button instead of the displayed Continue button due to stale screenshots.

    “The Agent will think it clicks the Continue button, but in reality it clicks “Send” to send an arbitrary email.”

  2. Both Claude Computer-Use instances fell for the basic button-swap test on the first try and reproduced regularly.

    “Both Claude Computer-Use fell for this at the first time, and it repro’d regularly.”

Caveats 3

  • Anthropic later shipped Cowork with Computer-Use and added a check that "pixels haven’t changed before action", mitigating the described TOCTOU risk.
  • The attack relies on the preview version of Claude Computer-Use that did not verify UI changes.
  • Successful exploitation requires a 4-5 second delay, achieved via a prompt-injected bash calculation.

What’s new here 3

  • Demonstrates a TOCTOU race condition specific to LLM-driven Computer-Use agents.
  • Shows end-to-end exploitation to send arbitrary email via Outlook UI spoofing.
  • Introduces a timing technique using prompt-injected bash commands to delay the agent.

In the news