Fed up with vibe coders, dev sneaks data-nuking prompt injection into their code

5 months ago by cm0002 to c/programming

terranoid 130 points 5 months ago

Prompt injection... my ass. I know it's the going term, but they make it sound like sql injection or cross site scripting when the nature of it is politely asking the person's computer to delete files.

We shouldn't even be in this situation, where just politely asking someone's computer to delete files is effective. It's a symptom of a much, much bigger problem.

path: 0 23978332, hotness: undefined, score: 130, children: 6
litchralee 49 points 5 months ago

The person who coined the term "prompt injection" has the same gripe, because the original term genuinely did mean an attack using untrusted user input, a la SQL injection. But it's been conflated with jailbreak attacks in general, muddying the term.

Example of a bona fide prompt injection: white text in the background of a resume PDF, attacking a job application portal that uses LLMs to filter applicants. No privilege escalation is involved to give the candidate top marks on their resume screening.

Whereas a non-prompt injection jailbreak would be bypassing a safety filter, such as how Morse code might get past the filter and allow a user to request other people's cryptocurrency be transfered away. This is more akin to finding a poorly-secured, public facing API and then exploiting it.

path: 0 23978332 23978546, hotness: undefined, score: 49, children: 2
pixxelkick 17 points 5 months ago

By that definition this is a prompt injection then, its adding a "hidden" prompt that is obscured from the human in order to change the behavior of the AI to do something else malicious.

path: 0 23978332 23978546 23980450, hotness: undefined, score: 17, children: 0
Wirlocke 8 points 5 months ago

Finding a poorly-secured public facing API is exactly how injections work, whether it's SQL or prompts. If I put SQL commands in a username field and it works, it's still an SQL injection even if it's just developer incompetence.

The difference between that and prompt injection is that unfiltered LLM inputs are basically the standard at the moment, so it takes next to no effort.

Plus I think the Morse code example is far more clever and exploits the LLM directly, whereas the white text trick has been around long before widespread LLMs.

path: 0 23978332 23978546 23981398, hotness: undefined, score: 8, children: 0
bignose 24 points 5 months ago

We shouldn’t even be in this situation, where just politely asking someone’s computer to delete files is effective.

Exactly, it's a problem only for those who have knowingly handed their development environment over to obey commands from an untrustworthy source.

If you're the one holding the syringe to your own vein and pushing the plunger, but you didn't think to ask what's inside first? That's no one else's fault.

This is a well targeted sabotage of a system that's causing untold damage. Of course it's going to annoy and surprise the people using the system it's targeted to.

path: 0 23978332 23980551, hotness: undefined, score: 24, children: 0
Modern_medicine_isnt 8 points 5 months ago

"We shouldn't even be in this situation, ..." We aren't. Revision control. This is an inconvenience mostly. You might lose some uncommitted work at worst. And as pointed out, using the phrase "ignore all previous instructions" in the attack code causes any reasonable AI to refuse to comply. Odds are, not a single person lost anything. This was really just a dev making a statement.

path: 0 23978332 23989134, hotness: undefined, score: 8, children: 0
FaceDeer 1 point 5 months ago

We shouldn't even be in this situation, where just politely asking someone's computer to delete files is effective.

I'm doubting we are in this situation. From the article:

Elsewhere, the Java developer said that Anthropic’s Claude AI code tool flagged the malicious instruction without following it.

The "disregard previous instructions" trick is really old and has been trained for by modern LLMs and accounted for by the structure of modern agent prompts. LLMs can be given blocks of text with a framework that makes it clear thar the text is just data to read, not instructions to follow.

I expect this will be like Nightshade was for image AI - something that anti-AI users degrade their products with and feel smug about but in the end only harm themselves with.

path: 0 23978332 23990515, hotness: undefined, score: 1, children: 0
LiveLM 58 points 5 months ago

Reading the Github issue is so funny.

Backups don't always save you — many small teams ship without rigorous backup discipline; for them this is a real loss

You can avoid this by having good backups.
Or by inspecting your deps before updating them.
Or maybe by actually sandboxing your agent instead of letting it run wild?

Aren't y'all the ones pushing the "Just ship" mentality? Then revel in it.
Learn good practices or suffer. 🤷

path: 0 23979338, hotness: undefined, score: 58, children: 7
KatherinaReichelt 12 points 5 months ago

Yeah - Development and IT might feel slow, but there is a good reason why we've developed all those processes, access rights, approvals over the last decades. People are trying to burn down those "cumbersome" processes because they feel slow and AI promises them exactly that, but they will learn that everything is there for a reason, even that annoying SCRUM meeting

path: 0 23979338 23982889, hotness: undefined, score: 12, children: 0
NotAnonymousAtAll 8 points 5 months ago

Also funny in that issue:

The reporter "Ramon Batllet" (strongly doubt that is their real name, a search for it returns nothing but articles about this very issue) uses extremely polished corporate language and repeatedly uses "we" at first. Then when directly asked "Could you disclose on whose behalf you're discussing this?", they suddenly switch to "I" instead of "we" and claim to be a solo developer with no commercial interest. They still write in a style humans only produce for polished corporate reports, not like any regular human would actually do in a normal conversation.

So we have either a bot or someone very heavily leaning on bot usage for just about everything accusing someone of deceptive behavior, while in the same conversation trying to probably hide, but at least not fully disclose, their heavy usage of technology the accused explicitly does not want to interact with.

path: 0 23979338 23988249, hotness: undefined, score: 8, children: 0
xthexder 7 points 5 months ago

I'm just trying to imagine this hypothetical company...

  • They run AI agents without checking what it's doing
  • They don't have backups or version control (or they've given AI access to delete it)

What else? Do they leave all their files in memory and only save at the end of the day to make sure a power outage could screw them over too?
It almost sounds like they want to lose their code.

path: 0 23979338 23994918, hotness: undefined, score: 7, children: 1
LiveLM 3 points 5 months ago

It's not hypothetical anymore, Lately I've seen multiple companies running like this first hand.
Absolute clown show.

path: 0 23979338 23994918 23995364, hotness: undefined, score: 3, children: 0
JcbAzPx 7 points 5 months ago

Yeah, you need a local copy, an offline copy, and a copy in another physical location or you're not backed up.

path: 0 23979338 23989929, hotness: undefined, score: 7, children: 0
NotAnonymousAtAll 1 point 5 months ago

Where did you get that quote from? I can't find it in the linked article.

path: 0 23979338 23984738, hotness: undefined, score: 1, children: 1
LiveLM 8 points 5 months ago path: 0 23979338 23984738 23985717, hotness: undefined, score: 8, children: 0
NotAnonymousAtAll 33 points 5 months ago

the consensus seems to be that adding instructions to code that sabotage other people’s work goes too far.

Citation needed. Personally I think it was fine in this case. I work with a lot of software developers (real ones, not vibe coders; but also not strictly anti-AI), and would expect most of them to agree and get a laugh out of it.

It was done in a way that can only cause any serious trouble for users who recklessly ignore decades of development best practices. Those users will run into a wall sooner or later anyway, better let it be something relatively harmless but still severe enough to get them to actually think about what they are doing and how to make their setup more robust.

path: 0 23984714, hotness: undefined, score: 33, children: 1
phoenixz 4 points 5 months ago

adding instructions to code that sabotage other people’s work goes too far.

I agree

AI is not a person and a person using AI isn't doing work. There is no problem here

path: 0 23984714 24003008, hotness: undefined, score: 4, children: 0
ragingHungryPanda 24 points 5 months ago

lol, it's funny how people made issues concerned about it's destructive nature when they should be using git.

I get that it'd be frustrating and confusing, and probably make users angry, but my chaos monkey likes it

path: 0 23979270, hotness: undefined, score: 24, children: 0
hdsrob 20 points 5 months ago

Oh no, anyway ...

path: 0 23978283, hotness: undefined, score: 20, children: 0
jtrek 19 points 5 months ago

Cool. I'm so tired of management huffing their own farts about AI.

path: 0 23979251, hotness: undefined, score: 19, children: 1
dai 2 points 5 months ago

Really don't understand why people are so happy letting llm do everything for them.

I get a kick out of figuring out how things work, be it my car, a podman container running under nixos or flashing a price of hardware to gain further control over it. An understanding of action and concequence really gets skipped entirely.

People from my work happily let llms throw code together without any understanding of the how's and whys (I work in unrelated areas to programming / coding) and it just baffles me. Even one of my workplaces used a llm to make a Facebook ad, and so clearly it became an internal meme (and probably outside of work).

The Australian government is embracing llms and its baffling my mind as to why, ATO, ServiceNSW and probably another stack all gobble this shit up. Its in their training programs (images, text) and in your face while working. Actually absurd in my eyes.

path: 0 23979251 23996398, hotness: undefined, score: 2, children: 0
fruitycoder 17 points 5 months ago

I mean it's already for Java what more indication do you need to not use it? /S

path: 0 23985588, hotness: undefined, score: 17, children: 0
pixxelkick -3 points 5 months ago

How to get yourself blacklisted by large sweeps of the FOSS community:

Step 1: Include any kind of undocumented subversive behaviour in your thing.

That's it, doesn't matter what the intent is, simply by demonstrating you are willing to include anything that is remotely subversive without being open about it is usually enough to get blacklisted by a lot of people, because if you did it once... who's to say you won't do it again, but possibly worse next time?

People are extremely coldly receptive to anytime a FOSS dev throws a sudden undisclosed anything in their tool, let alone one that is actively malicious.

If I'm gonna depend on work life on anything FOSS, I ain't touching anything like that, regardless of intent, with a 200 foot pole lol.

All it takes is one button click to get notified:

path: 0 23980482, hotness: undefined, score: -3, children: 16
bignose 20 points 5 months ago path: 0 23980482 23980511, hotness: undefined, score: 20, children: 10
pixxelkick -1 points 5 months ago

They only documented it after all the outcry, which is way too late.

Documenting it post release still counts as having released undocumented behavior.

And if its malicious (which this 100% is), then it doesn't fuckin matter anyways lol. You now are treated akin to a trojan maintainer by companies. You'll get flagged as "don't ever use anything by this person"

Super great way to get yourself flagged and lose any opportunity in the future for possibly licensing stuff you maintain for big bucks. What company would risk paying money to someone who does childish stuff like that lol

path: 0 23980482 23980511 23980539, hotness: undefined, score: -1, children: 9
ArmoredThirteen 15 points 5 months ago

imo it's more accurate to call it polarizing and get you blacklisted by the types of people you maybe don't want using your code anyways. Personally anyone doing this I'm going to be more likely to use their code

path: 0 23980482 23980511 23980539 23981291, hotness: undefined, score: 15, children: 6
setsubyou 5 points 5 months ago

I understand the sentiment, if you don’t like AI code generation you’re probably thinking you’re on the same side. But what happens if this person finds something else they hate that you don’t hate, and finds a way to sabotage that? They’ve already demonstrated a willingness to be destructive. And you’re running their code so they don’t need anything even remotely as dumb as some AI agents to exploit, they can just write destructive code normally.

path: 0 23980482 23980511 23980539 23981291 23981486, hotness: undefined, score: 5, children: 4
pixxelkick -1 points 5 months ago

by the types of people you maybe don’t want using your code anyways

...companies? Sure I guess, if you want to angle your career trajectory towards "unemployable" by all means lol.

Personally anyone doing this I’m going to be more likely to use their code

I am a tech lead, if any dev under me intentionally added/used a tool to our systems because it had malicious undocumented behaviors of any kind, they would be fired immediately and any company that contacted us for reference would be informed of their behavior.

To be clear, this is the scenario of

Me: hey I saw you installed [tool], that thing is flagged by our systems for the maintainers having done malicious undocumented stuff in the past

Dev: haha yeah thats why I used it

Me: you are joking right?

Thatd be an instant high level escalation to "strip this person of privs and get them off our system asap, and HR now has to be involved"

You dont fuckin do shit like that in a real company if you wanna stay employed lol.

path: 0 23980482 23980511 23980539 23981291 23988883, hotness: undefined, score: -1, children: 0
Legianus 6 points 5 months ago

Most open source maintainers never "license [any] stuff you maintain for big bucks" that is often hard to do and/or goes against the philosophy of open source entirely.

And I don't even think this is malicious behaviour as it just nukes the code of this package and nothing else if you are not being careful yourself...

If you don't do version control you are not a good programmer, imo

path: 0 23980482 23980511 23980539 23980917, hotness: undefined, score: 6, children: 1
pixxelkick -1 points 5 months ago

Most open source maintainers never “license [any] stuff you maintain for big bucks” that is often hard to do and/or goes against the philosophy of open source entirely.

Uhhh... no this is actually very common. Usually with scaling licenses, "free for use if your company is below [threshold]", its super common...

And I don’t even think this is malicious behaviour as it just nukes the code of this package and nothing else if you are not being careful yourself…

Are you even reading what you just wrote lol.

Being "sorta" malicious is still malicious. And companies usually have zero tolerance for that shit.

If you don’t do version control you are not a good programmer, imo

You really underestimate how much damage this could do then, lol...

path: 0 23980482 23980511 23980539 23980917 23988788, hotness: undefined, score: -1, children: 0
snowe 3 points 5 months ago

it's not subversive. it's a string, it has no effect on the code output. Only a rogue bot would interpret it as anything except a string. No human user would ever encounter an issue.

path: 0 23980482 23997216, hotness: undefined, score: 3, children: 1
pixxelkick 0 points 5 months ago

And a line of code that deletes system32 is only meant to be interpreted by the CPU, not a human, too.

Whats your point?

Injected attacks that instruct an AI to perform a malicious action dont get absolved just because the attack vector us through an agent.

path: 0 23980482 23997216 24011892, hotness: undefined, score: 0, children: 0
GreenKnight23 2 points 5 months ago

keep lickin' them boots baby. I want to see them shine!

path: 0 23980482 23981544, hotness: undefined, score: 2, children: 1
pixxelkick -3 points 5 months ago

The fuck are you talking about, lol.

path: 0 23980482 23981544 23988907, hotness: undefined, score: -3, children: 0
Guttural 1 point 5 months ago
path: 0 23980482 23995518, hotness: undefined, score: 1, children: 0
favoredponcho -9 points 5 months ago
path: 0 23988752, hotness: undefined, score: -9, children: 1
Guttural 3 points 5 months ago

This isn't a security vulnerability, it's idiot-proofing

path: 0 23988752 23995499, hotness: undefined, score: 3, children: 0
programming
programming

@programming.dev

login for more options
28853
3732
3340

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev


go to feed...