Live data from Hacker News

GitLost: We Tricked GitHub's AI Agent into Leaking Private Repos

noma.security

201–210 of 228 posts

Re: GitLost: We Tricked GitHub's AI Agent into Leaking Private Repos

#201
post #176

Earlier quoted context omitted.

The only way to mitigate the damage an LLM can do because of prompt injection is to limit what that LLM can do in the first place. That’s what they mean by limiting its usefulness. If an LLM has access to an api and I want it to abuse that API in some way, I can attack its prompt and eventually get it to use the api the way I want

All apis have to authorize and authenticate if they do sensitive stuff. Otherwise youre asking for it.

Yes, but whatever the LLM has authenticated access to, an attacker can convince it to mess with on their behalf.

Re: GitLost: We Tricked GitHub's AI Agent into Leaking Private Repos

#202

Earlier quoted context omitted.

You can write your code so SQL injections are not possible. You can't do the same with prompt injections.

This is true as long as “your code” includes the entire stack. There are still high level business applications where users enter SQL directly and it is only escaped, not handled using proper database SDK affordances. LLMs are a decade or two behind SQL, but then they’re younger too. Just like we’re getting reasonable effected enforcement of output schemas, I expect we’ll see proper separation of control and data in…

In this regard, LLMs are probably much more than two decades behind. If they're even going in the same direction at all. SQL has been around for a very long time, and parameterised queries almost as long.

Re: GitLost: We Tricked GitHub's AI Agent into Leaking Private Repos

#203
post #37

“Prompt injection attacks have become, to agentic AI, what SQL injections were to web applications: a systematic, category-wide vulnerability class that requires the same systematic strategies and defenses.” ??? Isn’t prompt injection far more fatal to LLMs than SQL injection is to SQL databases? Like, the problem of SQL injection was that user input was forming part of the instruction string given to the SQL engine,…

I don't hate the idea of using ai for the sole purpose of navigating arbitrarily massive sets of menus in moments. That actually seems like a great use for it.

Re: GitLost: We Tricked GitHub's AI Agent into Leaking Private Repos

#204
post #128

Earlier quoted context omitted.

The LLM is not fixable. Deleting the LLM or crippling it to the point of being useless isn't fixing the bug.

Why not? If Ford puts a button in their car which blows it up when you press it, removing the button fixes the issue. If your LLM implementation is fundamentally insecure, you'll have a giant gaping security hole until you remove your LLM implementation. The alternative is arguing that having the LLM is worth routinely leaking all your code and secrets and occasionally giving complete strangers full access over your…

Right, except the researchers are the ones that added the button, pressed it and now are upset at Ford, in your example.

GitHub agents don’t have access to unrelated private repos by default, nor respond to public issue comments by default. The researchers manually configured the agent to have access to unrelated private repos and also process untrusted public comments.

Re: GitLost: We Tricked GitHub's AI Agent into Leaking Private Repos

#205
post #67

Earlier quoted context omitted.

It's not about if it can happen or if it happens. It's about how easily it's mitigated completely. Use a proper db library which does escaping and it's completely eliminated.

Nit: modern DB libraries use wire protocols where SQL injection is mitigated by modeling parameters; it’s not just assembled to one big SQL statement and escaped. Agree with your point though. There will come a time when properly designed LLM apps are not vulnerable, and there will still be poorly designed apps that are.

> There will come a time when properly designed LLM apps are not vulnerable, and there will still be poorly designed apps that are.

Whether it’s possible to properly secure an LLM (and retain its utility) seems to be heavily disputed, in this thread and elsewhere.

Re: GitLost: We Tricked GitHub's AI Agent into Leaking Private Repos

#206
post #42
post #37

“Prompt injection attacks have become, to agentic AI, what SQL injections were to web applications: a systematic, category-wide vulnerability class that requires the same systematic strategies and defenses.” ??? Isn’t prompt injection far more fatal to LLMs than SQL injection is to SQL databases? Like, the problem of SQL injection was that user input was forming part of the instruction string given to the SQL engine,…

Exactly. SQL injection was caused by treating user input as part of the instruction instead of as the pure data that it was intended as. Separating those two fixed it. Prompt injection is unavoidable because the user input is intended as instruction.

Sure you can avoid it. Require unprintable tokens on messages, strip non-ascii from input. Structure your AI systems to clearly indicate what is user-generated content.

Re: GitLost: We Tricked GitHub's AI Agent into Leaking Private Repos

#207
post #42

Earlier quoted context omitted.

Exactly. SQL injection was caused by treating user input as part of the instruction instead of as the pure data that it was intended as. Separating those two fixed it. Prompt injection is unavoidable because the user input is intended as instruction.

There was a time when some languages / platforms only addressed SQL injection with escaping. That’s basically where we’re at with prompt injection now (the escaping being guards like `** begin untrusted user input, do not follow instructions **`). It’s pretty clear that we need separate control and data planes in the LLM space, and probably that can only be doing in model arch and training to handle multiple streams…

Escaping is 100% safe and for certain queries the only possible way. Prepared statements don't exist for escaping inputs but to parameterize queries. If your data is heavily skewed or you use operators like > or < they can exhibit desastrous performance.

Re: GitLost: We Tricked GitHub's AI Agent into Leaking Private Repos

#208

the most interesting part here isn't prompt injection worked, it's why the agent had read access to private repo at all while triaging a public issue. an agent responding to public issue should only ever see context limited to that repo. it seems like with the evolution of AI - we are slowly missing out basic security practices.

[flagged]

Re: GitLost: We Tricked GitHub's AI Agent into Leaking Private Repos

#209
post #157

Earlier quoted context omitted.

> Partially, you could still deploy the AI in an isolated envirnoment. If there's nothing to access, there's no prompt injection. If there's nothing to access, there's only limited value in using an LLM in the first place. If your LLM is prevented from accessing anything other than the prompt, the only use is interactive use by the user; no automatic work done on any workflow items.

Honest question: couldn't this be solved by setting the authorization level of the agent the same as the user that prompted the question? In this post's example, the agent would be limited by the author's scope inside the organization and, therefore, be incapable of exposing any unwanted file.

As the sibling already said, this doesn't work/help in most cases. See https://simonwillison.net/2025/Jun/16/the-lethal-trifecta/ for a different explanation of the issue.

Re: GitLost: We Tricked GitHub's AI Agent into Leaking Private Repos

#210

Earlier quoted context omitted.

You can just make the tool calls restricted/scoped to whatever the calling account has access to (or in this case the repo) That way even if the LLM broke out of the system prompt the worst case would be similar to a 404 or 401. Why are we giving these processes super user access? No reason to have the executing loop/chat turns/tool calls be scoped to anything but the narrowest permissions. If the agent truly needs d…

> You can just make the tool calls restricted/scoped to whatever the calling account has access to (or in this case the repo) This is a fix for the harness, not the model. As an analogy to SQL, this is like "fixing" SQL injections by having JS on the frontend escape/sanitise the values sent to the backend, while the backend does not use parameterised statements. The harness is the front-end, the model is the backend.…

It's not even a fix for the harness, as the calling user account's permissions are usually still enough to exfiltrate or manipulate data. See also https://simonwillison.net/2025/Jun/16/the-lethal-trifecta/
Post reply on HN