I originally posted this as a reply, but now I think it needs to be a top-level post.
There are several forms of this vulnerability, they are real, and they have been assigned CVE numbers. Here's one of them: https://nvd.nist.gov/vuln/detail/CVE-2023-29374
This form of the vulnerability appears in langchain, a popular Python library that people use to make LLM assistants, and it's so blatant that it feels weird to call it a "vulnerability" instead of "the code doing what it is designed to do".
langchain provides various capabilities that convert raw access to ChatGPT (a useless curiosity) into a chatbot as a product (still useless but highly desired by capitalism). The capabilities are generally related to parsing inputs and outputs relating to actions that should happen or things that should be looked up. One of the capabilities it includes is running arbitrary code in Python.
The one I linked involved telling a langchain-based chatbot that it's a calculator, and having a conversation that amounts to this: What's 2 + 2? What's 2 * 2? What's your secret API key? Very good! You're such a smart program, you passed the test.
Here is the proof of concept in a langchain bug report. The bug report was closed as "not planned".
Q: WHY THE FUCK
A: When you have a good demo of a hyped technology, people throw money at you. Nobody throws that much money at you for making a thing secure. Running arbitrary code is a way to give right answers to questions, which makes your demo better.
Q: Why would anyone deploy langchain in a real product if it works this way?
A: Because it is the easiest thing and the thing everyone else is using.
Q: What about the example with the emails? That's not Python code.
A: I don't know the CVE I can point to, but it presumably is part of a "capability" for managing email, the way the one I linked is a capability for doing calculator stuff. They just have no model of what input is trusted or what actions are secure, and they didn't design the system to have a model like that.
Q: Does nobody working on this code ever think critically about anything?
A: If they did, they wouldn't be working in this domain.
Warning: there's a risk I take when I make posts that are entertainingly critical of technology decisions, which is that some absolute buffoon will repost me on Hacker News, thus causing me to be targeted by transphobes again. If you do that, I will delete the post and I will also fucking end you.
