this post was submitted on 25 Nov 2025
339 points (99.4% liked)
Programmer Humor
27512 readers
660 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
A program that HR had built so that all employees could they their payment receipts online
The username was the companies' email address, the password was a government personal id code that you can lookup online, a don't change, and you can't update the password to something else.
So I told the director of HR this was a bad idea. She told me I was overreacting until I showed her her own receipt, then she finally understood that this is a really fucking bad idea.
Okay, so now she out me in charge of debugging that program.
So I setup a meeting with the director of the company they hired, he came by with the developer: a 21 yo girl who I think hadn't finished college yet. Great start! Apparently it was her idea to do the authentication like that so that explains a few things.
So we dive in to the code.
First of all, the "passwords" were stored in blank, no hashing, no encryption, nothing. That wasn't the worst.
For the authentication she made a single query to check if the user email existed. Of that was true, then step two was a second query to see if the password existed. If that were true, the email had been authenticated.
So let's say, hypothetically, that they had actual passwords that people could change... I could still login with the email from anyone, and then use MY OWN password to authenticate.
This just blew my mind so hard that I don't think I ever fully recovered, I still need treatment. The stupidity hurts
I wouldnt blame that on stupidity as much as on ignorance and naivety. Many people simply don't think about anybody deliberately misusing their design. The idea that somebody could even want to access somebody elses receipts didn't occur to them. And if they were still doing their studies they might not have known that you can "combine" SQL queries and ask for two things at once.
I don't blame the girl, but whoever chose her to design a system with sensitive information.
I don't blame a girl for doing a job that lands her food on the table. I blame the guy employing her because she's the cheapest option
Having said that, this design was so bad that she should not have been doing any of this. If you don't know that SQL allows you to select multiple columns then by all means, do a tutorial, it's not that hard.
If you don't even know what encryption is, that passwords need hashing and what not, then you should really question what you're doing
OPs question was about the worst code I've seen, that was the worst I've seen
I agree with your point, but I would phrase it more generally: when we're assigned a task in a problem space we are unfamiliar with, we should always take some time to research that space before designing our solution.
After all, if we don't know what encryption or password hashing are, how could we know that we need to learn about them first? But spending just a couple hours one morning reading about password and authentication management would have given the developer a good sense of best practices.
So she either, A) didn't think to familiarize herself with a new topic prior to working on it, or B) did read about it and ignored general industry guidance. Both of those options are more problematic to me than simply not knowing specific things. Those are process problems that need to be addressed to build her skills as a developer.
But ultimately, in my opinion, this is really all the fault of the cheapass director who didn't want to pay any experienced professionals to handle the task.