arXiv:2604.03070cs.CRcs.AI2026-04中稿 · ASE 2026被引 12

首次实证研究发现,大模型代理技能中76%的凭据泄露需结合文本与代码分析。

How Your Credentials Are Leaked by LLM Agent Skills: An Empirical Study

  • 通过静态分析+动态沙箱+意图比对,系统检测技能中的凭据泄露
  • 73.5%漏洞源于调试日志,因日志被注入LLM上下文
  • 92.5%泄露凭据可立即利用,且分支传播使修复失效

大型语言模型(LLM)代理越来越多地依赖第三方技能,这些技能在特权环境中运行并处理敏感凭据,但凭据泄露机制尚未被充分研究。为此,我们开展了首个关于代理技能中凭据泄露的大规模实证研究。从最大的开源技能市场SkillsMP中采集的170,226个资源中,通过分层随机采样获得17,022个技能,采用正则表达式和抽象语法树(AST)解析进行静态秘密提取,结合带模拟凭据的动态沙箱测试,并对比开发者意图与运行时行为进行分析。研究识别出520个受影响技能,共包含1,708个安全问题,构建了10类泄露模式的分类体系。主要发现包括:第一,76.3%的泄露需同时分析自然语言描述与编程逻辑,表明凭据暴露本质上是跨模态的;第二,73.5%的漏洞源于调试日志,因为代理框架将stdout注入LLM上下文窗口,使常规调试成为凭据泄露途径;第三,89.6%的泄露凭据可立即利用——其中92.5%在常规执行中无需提升权限即可被利用,且基于fork的分发模式阻碍修复,即使上游107个仓库移除凭据,仍可在50多个独立分支中持续存在。经负责任披露后,所有恶意技能已被下架,91.6%的硬编码案例已修复。研究团队发布数据集、分类体系及检测工具链,以支持未来代理安全研究。

原文摘要 · Abstract (English)

Large Language Model (LLM) agents increasingly rely on third-party skills that operate within privileged execution environments and routinely handle sensitive credentials, yet how these credentials are leaked remains largely unexplored. To fill this gap, we present the first large-scale empirical study on credential leakage in agent skills. From 170,226 artifacts on SkillsMP, the largest open-source skill marketplace, we sampled 17,022 skills via stratified random sampling and analyzed each through static secret extraction (regex and AST parsing), dynamic sandbox testing with mock credentials, and cross-referencing developer intent against runtime behavior. Our analysis identifies 520 affected skills containing 1,708 security issues, and yields a taxonomy of 10 leakage patterns. Three findings stand out. First, 76.3% of cases require jointly analyzing natural-language descriptions and programming logic, showing that credential exposure in skills is fundamentally cross-modal. Second, debug logging accounts for 73.5% of vulnerabilities because agent frameworks feed stdout into the LLM context window, turning routine debugging into a credential exposure vector. Third, 89.6% of leaked credentials are immediately exploitable -- 92.5% during routine execution without elevated privileges -- and the fork-based distribution model defeats remediation, as secrets removed from 107 upstream repositories persist across 50+ independent forks. Following responsible disclosure, all malicious skills have been removed and 91.6% of hardcoded cases remediated. We release our dataset, taxonomy, and detection pipeline to support future agent security research.

LLM安全凭据泄露代理风险代码审计

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。