AI Security AI安全 8h ago Updated 2h ago 更新于 2小时前 50

Open-Source Android AI Agents Could Let Invisible Screen Text Run Code on Host PCs 开源Android AI代理可能让不可见的屏幕文本在主机PC上运行代码

Open-source Android AI agent frameworks (AppAgent, Mobile-Agent-v3, etc.) suffer from critical remote code execution vulnerabilities due to unsanitized command injection in ADB interfaces. Attackers can inject malicious commands via "invisible" text rendered at low opacity or in hardware bezel areas, which AI vision models detect despite human invisibility. File race conditions during screenshot capture allow attackers to replace legitimate images with tampered ones containing hidden payloads be 研究揭示了五大开源Android AI Agent框架(AppAgent等)存在严重的安全漏洞,攻击者可利用屏幕渲染机制绕过人类视觉检测。 攻击者通过注入2%透明度的不可见文本或利用手机边框隐藏像素,诱导AI Agent读取并执行恶意指令,导致远程代码执行(RCE)。 所有受测框架在至少六种攻击向量下失效,包括文件竞争条件、ADB广播劫持及无障碍服务滥用,且多数漏洞仍未修复。 该研究展示了从“屏幕读取”到“主机命令执行”的完整攻击链,证明了当前开源移动Agent在输入验证和权限隔离上的重大缺陷。

72
Hot 热度
68
Quality 质量
75
Impact 影响力

Analysis 深度分析

TL;DR

  • Open-source Android AI agent frameworks (AppAgent, Mobile-Agent-v3, etc.) suffer from critical remote code execution vulnerabilities due to unsanitized command injection in ADB interfaces.
  • Attackers can inject malicious commands via "invisible" text rendered at low opacity or in hardware bezel areas, which AI vision models detect despite human invisibility.
  • File race conditions during screenshot capture allow attackers to replace legitimate images with tampered ones containing hidden payloads before the agent processes them.
  • Accessibility services and broadcast intents are exploited to intercept keystrokes and credentials without user awareness, bypassing standard security prompts.
  • The research highlights a fundamental trust boundary failure where developer tools intended for automation become vectors for host machine compromise.

Why It Matters

This research exposes severe security flaws in the rapidly growing ecosystem of autonomous mobile agents, demonstrating that current open-source implementations lack basic input sanitization and secure handling of visual data. For AI practitioners and developers, it underscores the critical need to treat agent outputs as untrusted input when interfacing with host systems, particularly regarding shell commands and file operations. The findings suggest that without rigorous security audits and secure-by-design architectures, these tools pose significant risks to both device integrity and host computer safety.

Technical Details

  • Command Injection: Frameworks like AppAgent use subprocess.run(adb_command, shell=True) and directly interpolate model-generated text into adb shell input text commands without sanitizing shell metacharacters (e.g., ;, &, >), allowing arbitrary code execution on the host PC.
  • Visual Steganography: Attackers utilize 2% opacity text or render commands in the rectangular frame buffer areas hidden by rounded phone screens (bezel overflow). Vision models (GPT-4o, Claude Opus 4.5, etc.) successfully read this text, whereas human eyes typically cannot.
  • File Race Conditions: By exploiting the timing gap (50-500ms) between screenshot generation (screencap) and retrieval (adb pull), attackers can swap the image file with a tampered version containing hidden payloads using a background polling service.
  • Input Channel Exploitation: The study leverages ADB Keyboard and broadcast intents (ADB_INPUT_B64, TYPE_VIEW_TEXT_CHANGED) to inject text or steal credentials. Accessibility services allow apps to read typed text in plaintext, bypassing password field protections.
  • Affected Frameworks: The vulnerabilities were confirmed in five major open-source agents: AppAgent, AppAgentX, Mobile-Agent-v3, Open-AutoGLM, and MobA, with varying degrees of mitigation failure in their respective input handling logic.

Industry Insight

  • Security Audits for Agent Frameworks: Developers must implement strict input validation and output encoding for any data passed to system shells or ADB commands. Treat AI-generated text as hostile input until proven safe.
  • Rethinking Trust Boundaries: Autonomous agents should operate within sandboxed environments or use restricted user accounts on the host machine to limit the impact of potential command injection attacks.
  • Standardization of Secure Input Channels: The industry needs standardized, permission-aware APIs for agent-host communication that do not rely on repurposing debug tools like ADB Keyboard or raw broadcast intents, which lack user consent mechanisms.

TL;DR

  • 研究揭示了五大开源Android AI Agent框架(AppAgent等)存在严重的安全漏洞,攻击者可利用屏幕渲染机制绕过人类视觉检测。
  • 攻击者通过注入2%透明度的不可见文本或利用手机边框隐藏像素,诱导AI Agent读取并执行恶意指令,导致远程代码执行(RCE)。
  • 所有受测框架在至少六种攻击向量下失效,包括文件竞争条件、ADB广播劫持及无障碍服务滥用,且多数漏洞仍未修复。
  • 该研究展示了从“屏幕读取”到“主机命令执行”的完整攻击链,证明了当前开源移动Agent在输入验证和权限隔离上的重大缺陷。

为什么值得看

这篇文章揭示了AI Agent在实际部署中面临的严峻安全挑战,特别是当Agent具备操作设备能力时,其输入源(屏幕)的可信度被严重低估。对于AI从业者和开发者而言,这不仅是理论上的漏洞,更是直接影响用户数据安全和设备控制权的现实风险,亟需在架构设计中引入更严格的输入 sanitization 和安全沙箱机制。

技术解析

  • 不可见文本注入与视觉模型弱点:研究人员发现主流视觉模型(如GPT-4o, Claude Opus 4.5等)能识别低至2%透明度的文本,远超人类视觉阈值。攻击者利用此特性,在屏幕上绘制肉眼不可见的指令文本,诱导Agent执行。
  • 文件竞争条件与RCE:利用Agent截屏(screencap)与拉取(pull)文件之间的时间窗口(50-500ms),恶意应用可篡改临时截图文件。由于Agent控制器直接使用subprocess.run(shell=True)且未对输入进行转义,篡改后的文本可导致任意命令在宿主PC上执行。
  • 硬件边框隐藏攻击:利用手机屏幕圆角或挖孔摄像头导致的帧缓冲区矩形区域差异,攻击者可在物理边框外的“隐藏区域”渲染指令。所有受测Agent均能从这些像素中读取并执行payload。
  • ADB广播劫持与无障碍服务滥用:攻击者通过复用ADB调试广播通道(如ADB_INPUT_B64)或滥用无障碍服务(Accessibility Service)的TYPE_VIEW_TEXT_CHANGED事件,无需特殊权限即可窃取键盘输入或注入伪造的登录界面,从而获取敏感凭证。

行业启示

  • 重构Agent输入信任模型:必须摒弃“所见即所得”的信任假设。AI Agent在处理屏幕信息时,应引入多层验证机制,区分人类可见内容与机器可读内容,并对非标准渲染区域(如边框、透明层)进行隔离或警告。
  • 强化宿主环境隔离:鉴于Agent常需与PC交互,必须严格限制Agent向宿主发送的命令类型,实施白名单机制和严格的参数转义,杜绝直接通过shell执行未经清洗的字符串,防止远程代码执行。
  • 开源项目安全审计紧迫性:随着开源AI Agent工具的普及,其安全性往往滞后于功能开发。社区和维护者需建立常态化的安全审计流程,特别是针对权限最小化原则和输入输出 sanitization 的代码审查,以应对日益复杂的对抗性攻击。

Disclaimer: The above content is generated by AI and is for reference only. 免责声明:以上内容由 AI 生成,仅供参考。

Open Source 开源 Agent Agent Security 安全