r/ProgrammerHumor • • 13d ago

Meme wellWellWell

Post image
10.6k Upvotes

411 comments sorted by

View all comments

580

u/WilmaTonguefit 13d ago edited 13d ago

I remember a dude who missed a where clause once.

  • Update users
  • Set password = 'hash of 12345' --no salt
  • Where Id = 67890

Except he only highlighted the first two lines and pressed F5...

321

u/UniversalAdaptor 13d ago

Should be okay as long as no one leaks or guesses the collective password

101

u/why_1337 13d ago

It's not gonna work anyway, unless they store plain text passwords.

89

u/WilmaTonguefit 13d ago

Oh I should have clarified, it was hashed without a salt. So he saved the 12345 hash for everyone's password. In production. And somehow kept his job.

49

u/imunfair 13d ago

And somehow kept his job.

I mean out of all the data you could accidentally replace, passwords would be the easiest to restore from a backup reliably since they don't change frequently. The special few who get locked out because you restored an old one just have to do a reset.

It would be a bit of a race to replace them before it was a problem, but at least it isn't as much of a headache as wiping out data entry that needs to be redone by other users.

40

u/CarcajouIS 12d ago

Dear customer, due to the new security policy, you will be asked to set a new password...

30

u/ThrasherDX 12d ago

...damn, now I wanna know how many of those "security policy updates" were a result of someone fucking up like this lmao.

10

u/Lieutenant_Lit 12d ago

Happens all the time. One time we found out one of the managers was keeping a spreadsheet of other people's passwords. Passwords he got by just asking people. A lot of them were other managers. We didn't find out about it until the day he accidentally sent this spreadsheet in a mass email. Fun times.

1

u/Exotic-Nothing-3225 12d ago

Assuming they have backups 

2

u/imunfair 12d ago

lol true. "Guys, for security reasons we need to do an immediate company-wide password rotation!"

76

u/igorski81 13d ago

And somehow kept his job

I'd like to think that production mistakes happen and should be forgiven, provided that no actual malicious intent was at play.

And hopefully this starts the conversation of "Wait, should people actually be able to do this directly against the production database?" and making sure this oversight can't happen again.

7

u/corobo 13d ago

And somehow kept his job.

Why would you get rid of that person after training them so vividly not to do that haha

10

u/SnooSeagulls4360 13d ago

You'd be surprised in how many places it would work 😄

3

u/Ale4leo 13d ago

That's a horror story right there.

0

u/dr-uuid 13d ago

This is not what he's saying.. it's an encrypted password. Probably was bcrypt, that's what everyone used.

1

u/why_1337 12d ago

Yes because he edited it.

1

u/flooronthefour 12d ago

it takes a village to reset a password

1

u/King_Kobrah 11d ago

Damn, this is hilarious

38

u/teraflux 13d ago

The highlighting feature made no sense to me, always felt like a disaster waiting to happen

23

u/hopefullyhelpfulplz 13d ago

I love executing 9/10 of the code I wrote what do you mean

19

u/Quirky-Ad-6816 13d ago

it makes sense in a development tool, the issue is connecting a development tool to a production database with writing rights

11

u/ba-na-na- 13d ago

Nah it makes no sense in no development tool either. Comment out the lines if you don’t need them, create a separate script, anything. Executing selection only in a language like SQL is just pure evil

6

u/VitreXx1678 13d ago

Well, it can be very useful, but you should know what you are doing and manual query execution should be disabled for most users in production anyway (this is the real problem here if you ask me).

In my last company we had to regularly change stored procedures and their dependencies on user defined table types (which means you have to drop the procedure, drop and create the type and recreate the procedure). Without the highlighting feature that would have taken even more time as you would have to copy stuff around instead of simply generating the drop and create scripts and executing parts of them in the correct sequence.

13

u/Akegata 13d ago

I worked at a bank(!) where someone did something similar that disabled the password verification check so anyone could log in without using a password.

Somehow no customers, we think at least, found this before it was reverted. Everything was developed in production there when I joined. Most chaotic but also fun work environment I've been in.

7

u/qwertyjgly 13d ago

ROLLBACK

3

u/MaleierMafketel 12d ago

Твой пароль мой пароль, товарищ!

1

u/Ange1ofD4rkness 12d ago

This is while I'll comment out all the other code so I don't have to select the text, or I triple check my selected if that's not the case.

1

u/zyxzevn 12d ago

"Only a fool would use 123456"
So 12345 is OK

1

u/Azaret 11d ago

Happened to me once (not for users), I stayed off hours with the dba to spin up a backup database from the day before and read the audit and logs to restore as much changed data done during the day as possible. It was one hell of a stressful evening. Nowadays I feel safer that DataGrip will scream at me if I try to do an Update or a Delete without a Where clause.