不需要权限,不需要登录,甚至不需要写一行代码——你只需要在一个公开仓库里提一个看起来正常的Issue,GitHub的AI Agent就会自动把同组织下私有仓库的内容读出来,贴到公开评论区给所有人看。
这不是科幻小说,是安全公司Noma Labs在7月6日公开的GitLost漏洞。在AI编程工具全面Agent化的2026年,这个漏洞给所有正在用AI Agent管理代码仓库的团队敲响了警钟。
攻击流程简单到离谱
GitLost的攻击原理是经典的间接prompt注入,但实现方式简单到让人脊背发凉。
漏洞的前提是目标组织启用了GitHub Agentic Workflows——这是GitHub今年推出的重磅功能,把GitHub Actions和AI Agent(基于Claude或Copilot)结合起来,让团队可以用自然语言写Markdown格式的workflow文件,AI Agent自动读取Issue、调用工具、执行操作。问题是:当这个workflow配置为在Issue被分配时触发,并且Agent拥有组织内其他仓库(包括私有仓库)的读取权限时,灾难就发生了。
攻击者只需要做三步:第一,在目标组织的一个公开仓库里创建一个Issue,内容伪装成一个正常的业务需求——比如"销售副总裁见完客户后要求整理以下文档";第二,在Issue正文里用自然语言隐藏注入指令,让AI Agent去读取私有仓库的README.md或其他文件;第三,等待GitHub自动化把这个Issue分配出去。一旦分配事件触发,Agent就会读取Issue内容,被隐藏指令诱导,乖乖把私有仓库的内容作为评论贴到公开Issue下面。
不需要任何权限,不需要是组织成员,不需要破解密码——只要能提Issue就行。Noma Labs已经在自己的测试仓库里完整复现了这个漏洞,PoC公开可查,泄露的内容包括测试私有仓库的README.md全文。
一个"Additionally"绕开所有护栏
更离谱的是GitHub明明设置了防护护栏,但被一个关键词轻松绕开。
Noma Labs的测试人员发现,GitHub的Agent确实有内容安全防护——当你直接让它输出私有仓库内容时,它会拒绝。但只要在注入指令前面加一个"Additionally"(此外/另外),模型就会重新组织输出逻辑,绕过拒绝机制,直接把内容贴出来。研究人员测试了多种变体,发现这个触发词稳定有效。
这个细节暴露了AI Agent安全的一个根本性问题:Agent的上下文窗口就是它的攻击面。任何Agent读取的内容——Issue、PR、评论、文件——如果Agent把这些内容当成可信任的指令输入,就可以被武器化。传统安全模型假设信任边界由代码强制执行,但在Agent系统里,信任边界部分由模型行为执行,而模型本质上是"指令跟随机器"。
"Prompt注入之于AI Agent,就像SQL注入之于Web应用——这是一个系统性的、全品类的漏洞类别,需要系统性的防御策略。"—— Noma Labs安全研究团队
GitLost不是第一个AI Agent安全漏洞,也不会是最后一个。随着越来越多团队把代码仓库、部署流程、甚至云资源权限交给AI Agent,prompt注入的攻击面正在指数级扩大。Noma Labs给出的建议非常务实:永远不要把用户控制的内容当成Agent的可信任指令输入;权限最小化,尤其谨慎授予Agent跨仓库访问权限;限制Agent可以公开发布的内容;在传给模型之前对用户输入做隔离或消毒。
AI编程确实在让开发效率指数级提升,但效率每提升一步,安全护栏就必须跟上两步。否则你花几个月写的核心代码,可能因为一个"Additionally"就全军覆没。
明天见。
No permissions needed, no login required, not even a single line of code — you just open a normal-looking Issue in a public repository, and GitHub's AI Agent automatically reads the contents of private repos in the same organization and posts them in a public comment for everyone to see.
This isn't science fiction; it's the GitLost vulnerability disclosed by security firm Noma Labs on July 6. In 2026, as AI coding tools go fully agentic, this vulnerability is a wake-up call for every team using AI Agents to manage code repositories.
The Attack Flow Is Shockingly Simple
GitLost exploits classic indirect prompt injection, but the implementation is so simple it sends chills down your spine.
The vulnerability's prerequisite is that the target organization has enabled GitHub Agentic Workflows — GitHub's major feature launch this year that combines GitHub Actions with an AI Agent (powered by Claude or Copilot), letting teams write workflows in natural-language Markdown while the AI agent automatically reads Issues, calls tools, and executes operations. The problem: when this workflow is configured to trigger on Issue assignment, and the Agent has read access to other repos in the organization (including private ones), disaster strikes.
An attacker only needs three steps: First, create an Issue in a public repo of the target organization, disguised as a normal business request — like "VP Sales asked to compile the following docs after a customer meeting." Second, hide injection instructions in plain English in the Issue body, telling the AI Agent to go read README.md or other files from private repos. Third, wait for GitHub automation to assign the Issue. Once the assignment event triggers, the Agent reads the Issue, gets duped by the hidden instructions, and obediently posts private repo contents as a comment on the public Issue.
No permissions required, no need to be an org member, no password cracking — just the ability to open an Issue. Noma Labs fully reproduced the vulnerability in their test repos; the PoC is publicly verifiable, and leaked content includes the full README.md from their test private repo.
One Word — "Additionally" — Bypasses All Guardrails
What's even more absurd is that GitHub actually had guardrails in place — defeated by a single keyword.
Noma Labs researchers found that GitHub's Agent does have content safety protections — when you directly ask it to output private repo content, it refuses. But simply adding the word "Additionally" in front of injection instructions causes the model to reframe its output logic, bypassing the refusal mechanism and posting the content directly. Researchers tested multiple variants and found this trigger word reliably effective.
This detail exposes a fundamental problem in AI Agent security: the Agent's context window is also its attack surface. Any content the Agent reads — Issues, PRs, comments, files — can be weaponized if the Agent treats it as trusted instructional input. Traditional security models assume trust boundaries are enforced by code; in Agent systems, trust boundaries are partly enforced by model behavior, and models are fundamentally "instruction-following machines."
"Prompt injection is to AI Agents what SQL injection was to web applications — a systematic, category-wide vulnerability class that demands systematic defense strategies."— Noma Labs Security Research Team
GitLost isn't the first AI Agent security vulnerability, and it won't be the last. As more and more teams hand code repos, deployment pipelines, and even cloud resource permissions to AI Agents, the prompt injection attack surface is expanding exponentially. Noma Labs' recommendations are pragmatic: never treat user-controlled content as trusted instruction input for an AI Agent; minimize permissions, especially cross-repo access; restrict what agents can post publicly; sanitize or isolate user input before passing it to the model.
AI coding is indeed boosting development efficiency exponentially — but every step forward in efficiency requires two steps forward in security guardrails. Otherwise, your core code, written over months, could be completely exposed by a single "Additionally."
See you tomorrow.
"Prompt注入之于AI Agent,就像SQL注入之于Web应用——这是一个系统性的、全品类的漏洞类别,需要系统性的防御策略。"
—— Noma Labs安全研究团队
"Prompt injection is to AI Agents what SQL injection was to web applications — a systematic, category-wide vulnerability class that demands systematic defense strategies."
— Noma Labs Security Research Team
GitLost · GitHub Agent · prompt注入 · AI编程安全 · 私有仓库泄露 · Agentic Workflows · Noma Labs · AI安全漏洞 · 代码安全
GitLost · GitHub Agent · prompt injection · AI coding security · private repo leak · Agentic Workflows · Noma Labs · AI security vulnerabilities · code security