Live data from Hacker News

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

noma.security

171–180 of 228 posts

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

#171
post #96
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.

This is the real problem with LLMs. There is no way to separate code from data. At best, models could be trained on tokens that indicate untrusted data coming in. But then the untrusted tokens could also be messed with. I've wondered if it would be possible for there to be two input streams: 1, for prompt, 2 for untrusted data. But I suspect that transformers would still only optionally decide what each one was for.…

My perception of real problem is that the LLMs were generic purpose tool and the focus was to improve their information retrieval and prediction. And they were fed with all this data (including private with was otherwise not available to everyone) for training purposes. The security and privacy of stored information was not really the requirement of this whole endeavor and all of sudden in the real world they are finding that this is a must requirement if they want to sell these models to enterprise companies.

And now all these security efforts to manage data privacy are akin to lipstick on a pig, they are brittle, costly, one-off. There are no boundaries inside the LLM storage, the training data is not encrypted at all in the memory across the pseudo tenants

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

#172
post #43
post #38

Earlier quoted context omitted.

Microsoft is a publicly traded company. Which investors are causing them to shit up GitHub with AI features nobody wants? In which venues?

The imaginary pressure of investors. When you actually ask investors if they care about most of the things CEOs think investors will care about, they don't.

If I'm picking a stock to buy (in the "retail" market, it's primarily based on a balance of EPS, P/E ratio, and a low(er) amount of debt.

My P/E filter filters out the likes of Nvidia, Amazon, etc, whereas my debt filter ensures the smaller cap companies won't be swallowed by their debt like many businesses are.

Who knows if I'm smart or an idiot.

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

#174
Do I understand this correctly: somebody at MSFT thought it would be a good idea to provide internal LLM with unfettered access to ALL of the GitHub code? “Just like SQL has”?

The difference is that (A) SQL is deterministic and (B) SQL implements internal access control (and how well that works).

Prompts from non-authenticated user should have no access to any private repositories. The real question is: can you trust MSFT GitHub with your code, now that “outsourced” engineers are supporting it?

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

#175
post #111

Earlier quoted context omitted.

> What if you mark the untrusted user input explicitly in the prompt, I think the more robust approach would be to have whatever embedding vector the model attributes to untrusted input and to directly attach that vector after every layer of transformation. Set a mask of where to apply that vector programmatically for every external input. That way it gets forced back into line if some sort of internal rationalisatio…

RFC 3514 was just ahead of its time

Implementering the evil bit solves all our problems, I agree.

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

#176
post #116

Earlier quoted context omitted.

Why is it limiting the usefulness? You have a set of apis that user can access to do something, the llm uses those same apis. How is that limiting usefulness? By not invoking apis user is not allowed to?

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.

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

#177
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…

> 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

No, we're in a far worse place. Escaping SQL is 100% reliable when you apply it to every field (and you don't mix up encodings, see mysql_real_escape_string). Prepared statements 'just' keep you from forgetting. The state of the art for separation in an LLM is a loose advisory at best.

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

#178

How is this a Github vulnerability? The researchers are the ones that grant the agent access to private repos and then ask it to answer questions in public repos.. of course this allows extracting private information? This is like setting up a normal CI job with access to secrets and running it on public PRs. If you configure GitHub to allow public code or LLM instructions to run in contexts that have access to sensi…

GitHub doesn’t exactly make it easy to configure agent access securely. In fact, their regular access tokens and app credentials don’t provide granular enough controls to give direct access to private repos securely. Even if tokens are tightly scoped, access to public repos is always allowed and exfiltration via public repo issues for example remains a vector. Securing this requires patching via MITM proxy that implements stricter controls than GitHub provides.

Now, presumably GitHub Agentic workflows are the proper 1st party solution for this exact issue, but seems like they still have some work to do, either on the security model, or at least in making it easier to use securely.

More on this here: https://haulos.com/blog/do-not-give-your-agent-github-access...

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

#179

Earlier quoted context omitted.

But they explicitly setup the permissions this way.

Half the crowd using GitHub ever thought about plugins that have org wide access but /promise/ not to misuse it. And years ago that included a lot of popular plugins (my POV was that those were outright stupid) -- on par with Docker in standard configuration: brain dead, works on my laptop idiocracy. I stopped disabling plugins from "managers" that overreached from their repos only to org wide years ago. While I like…

I also find this frustrating. Every time I want to add an app to Github, it defaults to org wide. So far, I've managed to keep the reins on that, and nobody has made a mistake, but I am just waiting for the day someone adds something org-wide that shouldn't be.

Another rant(ish). You can request a PAT for, say, 30 days for a repo, and if you don't have access, it'll prompt an admin to approve that PAT. Okay, makes sense. But then you can refresh that same token without permission going forward.

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

#180
post #143
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,…

Prompt injection isn't fatal. It's not even a real problem, or rather it just exposes problems in the underlying security architecture. Prompt injection is more like social engineering attacks on humans. The solution is the same: apply role-based access control with only the minimum rights, and require management approval for any important actions. That way the worst thing the LLM can do on its own is output some nau…

I think we more or less agree, with the caveat that I think social engineering attacks are far more worrisome and threatening than SQL injection. The gold standard solution to sql injection (prepared/parameterized queries) is guaranteed effective, and does not impede the efficacy of SQL. The gold standard solution for social engineering attacks (role-based access control with minimum rights) is only almost guaranteed, as the attack could be made against the management or admin who ultimately holds the keys to full rights, and most certainly does impede the efficacy of the humans operating under it.
Post reply on HN