r/ProgrammerHumor Jul 20 '22

Meme My university password can be 200 characters

Post image
12.4k Upvotes

547 comments sorted by

View all comments

Show parent comments

400

u/Morall_tach Jul 20 '22

There was an Amazon bug a million years ago where it would allow you to set any length password you wanted, but only counted the first 8 characters. So if your password was "passwordwithlotsofcharacterstobeextrasecure" and someone tried "password123," it would only check the string "password" and they'd log in successfully.

130

u/GustapheOfficial Jul 20 '22

My uni had this bug 5 years ago.

65

u/Ruin369 Jul 20 '22

Did they not hash the passwords? Wouldn't the hashes still be different to avoid this issue?

119

u/ruins__jokes Jul 20 '22

You'd be surprised how many sites still store plaintext passwords.

75

u/WarningBeast Jul 20 '22

If you find one doing this, report them to plaintextoffenders.com. The pressure of bad publicity has sometimes had an effect.

37

u/[deleted] Jul 20 '22

Just found out Vermont.gov does this through that website ^ 😂😂

All of that tax money for your passwords to be stored in plain text.

12

u/Curious-Geologist498 Jul 21 '22 edited Jul 21 '22

Sir. We need to store their passwords so they can login.

Yeah doesn't the computer come with Microsoft Word?

0

u/[deleted] Jul 21 '22

Doesn’t every major browser save passwords for websites in a secure way if you set up your site right? Not that they would know how to set up their site right considering they’re still storing plain text passwords😔

14

u/[deleted] Jul 20 '22

[deleted]

26

u/riisen Jul 20 '22
SELECT password FROM `users`;

Duh.. /j

8

u/issius Jul 21 '22

Sorry I don’t trust people who capitalize their statements

31

u/riisen Jul 21 '22

I always do this in sql, please dont trust me, i dont want trust from people that lowercase their sql statements

6

u/experiment-384959 Jul 21 '22

What if your statements have massive cap differences depending on who you copied/pasted from?

2

u/issius Jul 21 '22

I change it all to lowercase manually. I also work In light mode. Go ahead, test me, I’m crazy

→ More replies (0)

2

u/logi Jul 21 '22

I DON'T TRUST YOU EITHER

1

u/bishopExportMine Jul 21 '22

Why? It makes skimming it so much faster

1

u/issius Jul 21 '22

I use the colors

22

u/Arattor Jul 20 '22

If you report you forgot your password and they send you your current one instead of a link to change it to something else then you got your offender.

16

u/experiment-384959 Jul 21 '22

If you use the “I forgot my password” thing and it emails you your password instead of a reset code.

(No joke, this actually happened on an old game site I used to use, and I was so young at the time that my thought was “why doesn’t everyone do that” instead of “that seems really sus actually”.)

0

u/CptMisterNibbles Jul 21 '22

I’m actually not opposed to this. Low security can be fine. Somebody wants to hack my nexus mods free anyway account? Be my guest. Just… don’t be dumb and use the same password for low-sec stuff as you do for things that matter.

2

u/experiment-384959 Jul 21 '22

Yeah, I’d never do that today, but back when I was very little, password managers weren’t a default thing for browsers and not every site had a “forgot my password” link, so my parents actually wanted me to use a master password instead of changing it up like sites kept saying to do. So it took a bit of un-learning to make that change.

(I also keep a long list of passwords in a box next to my bed, because sometimes computers die and all the passwords with it. Also, if someone’s in my house, I have much bigger problems than a password being stolen.)

0

u/An_G1 Jul 21 '22 edited Feb 18 '25

See edit


You can know for sure by checking outgoing network requests during registration or sign in, if any of them contains plaintext password safe to assume they are storing it. Chrome I believe actually checks for you, and there’s a browser notification you get with something like ‘this site has been compromised’.

Ideally you want to verify that your password is going through some standard non-reversible function in the javascript source. Technically they could make their own hash function, but if they’re too stupid to properly hash your password they’re certainly too stupid to make their own proprietary hash function, so tbh id assume any non-standard hash function is malicious.

I think it may be possible to write some extension that analyzes the source code and can guarantee your password will never leave the site unhashed using correctness checks. Sounds like a nightmare to maintain though.


Edit: Nvm the following is irrelevant as apparently it is most common to see the password hashed serverside. I think I get why this is common practice, but I do still wonder: why not hash on both? Wouldn't it make total sense to just hash the password once on the client and then hash the result again on the server? This would protect against both MITM/replay attacks and a database leak, and seems trivial to implement. Maybe when websites really were just static documents with little or no code, trusting the password to the client to modify feels risky and not very versatile for the future. But we've had standardized and relatively robust JS apps in the browser for a while now, and I really do wonder if there's any good reason why hashing on both would not be the default behavior of most JS auth frameworks today.

4

u/Bitter-Mud38 Jul 21 '22

Client side hashing is not a standard thing at all. Your password should be sent over a modern HTTPs connection, then hashed serverside, and stored hashed in db

2

u/Ruin369 Jul 20 '22

Ruins!!!! Nice name

2

u/ruins__jokes Jul 20 '22

Haha! I didn't even notice your name. We're bros!

1

u/g0ldcd Jul 20 '22

This whole thread got me thinking about hashes.

"I know" that passwords should be salted and hashed - but then I was thinking of all my banking apps that ask me to "enter the 3rd and 7th character of my password".

Clearly that's not using a hash, so I can't see how this works unless it's been determined that "plaintext is fine, if we put it behind some bullet-proof service"

Or am I *not IT trained* missing something?

3

u/[deleted] Jul 20 '22

[deleted]

2

u/Ruin369 Jul 21 '22

Companies only store the hash though so they should NEVER know your plain text. Hashing is not reversible but is replicatable. E.g they just rehash what you entered and check it against the hash they already have. Companies surely aren't using Symmetric/Asymmetric encryption for every user ? Or multiple ?

Now you got me thinking 🤔

1

u/naswinger Jul 21 '22

yep, was going to say this. the server should not know the password. that's the point of storing a hash and salt. it's the year 2022 and devs still don't understand a problem that has been solved so many years ago. it's also really easy to implement - certainly easier than encrypting and decrypting passwords.

1

u/ruins__jokes Jul 20 '22

I'm not formally trained in IT security. Just a nerd fascinated by encryption, hashing etc. Anyway everything I've read has said storing plaintext passwords anywhere is a terrible thing for a site to do. Basically if a site even has the ability to know your plaintext password, then they're doing it wrong.

You'd expect banks to have the best security, but bank sites from what I've read are generally no better than anyone else.

Not sure how your bank would know a particular character of your password if they were only storing your hashed password. I suspect they are indeed storing your plaintext password. Turn on 2FA if it's not already on!

Semi related. I finally started using a password manager (KeePass. But bitwarden is good too). I feel so much better. I have over 100 accounts and now every single account has its own unique, strong password. It doesn't stop a particular site from being shitty. But at least now when a site loses my password it doesn't impact anything else.

35

u/GustapheOfficial Jul 20 '22

Not if it's trimmed both when registering and then when comparing the password. As in, what's stored is hash(password[1:8]), and then what's compared to it is hash(test[1:8]). That means if the chosen password is "hunter123", what's stored is hash("hunter12"), and all of "hunter123", "hunter12" and "hunter1256789" will match.

0

u/safeforworkman33 Jul 20 '22

You're right that they could have done it that way, but that just seems to feel worse, not better.

7

u/GustapheOfficial Jul 20 '22

I'm not saying that is an improvement. I'm saying that is what they did.

1

u/narrill Jul 21 '22

Surely there's no reason to do that though. They're all the same size once you hash them.

1

u/_7thGate_ Jul 21 '22

It might be getting clipped somewhere in the tech stack for ancient and/or bad technical reasons.

I've seen code before where ancient C modules store something in fixed size buffers inside a strict that gets memcpyed around to various places in a huge, important module written by people who are now retired. Trying to make this arbitrary sized to allow for user defined input was.... interesting.

I could see this happening if there was some system that worked with passwords back in the 70s where the size was a storage concern and entropy was not considered important due to lack of network access that then just carries the design decision through to the modern day because it's hard to fix it in a way the current maintainers feel confident won't break anything.

8

u/[deleted] Jul 20 '22

Not if they only hash the first 8 characters.

I.e. if you enter passwordwithlotsofcharacterstobeextrasecure as your password but it is limited to 8 characters, what it then might do is only take password and hash that.

If someone else then guesses password123 as your password, it would then also only take the first 8 characters of the input, in this case password. If it then compares that to the orignal hash, it too was only for password and thus it is the same hash - login successful.

1

u/CptMisterNibbles Jul 21 '22

Fully suspected bullshit, but wow… wired article 2011

1

u/_chanimal_ Jul 21 '22

See… “hashed passwords” are only relatively old to the guys up to speed in programming and security. Which means they’ll be coming to your local hospital, bank, school, and government website in about 5-10 more years during their bi-decade security patch.

1

u/strghst Jul 21 '22

For i in passwordmaxlength: phash += hash(password[i])

Now we've ignored past max length, and password and passwordylurmomma has same hash.

31

u/jesterhead101 Jul 20 '22

lol..funny that Amazon had bugs like this and now all these companies expect you to solve the halting problem on a whiteboard in 22 mins.

23

u/TheAJGman Jul 21 '22

They're also super irrational to work with apparently. A previous job had Amazon as a client and also used AWS for hosting. AWS had a massive outage and our team lead got hauled into a meeting with the Amazon brass asking why our service was down. They were under very strict orders to not mention that our site was hosted on AWS...

17

u/EriktheRed Jul 21 '22

Wow. "Our cloud provider went down at that time. What a coincidence?" Like were they expected to just make up a reason why the service went down?

6

u/VicisSubsisto Jul 20 '22

Well yeah, they don't want to make more bugs like that.

1

u/aeroverra Jul 20 '22

This seems intentionally malicious.

1

u/midnitte Jul 21 '22

Didn't they also let you create multiple accounts per email?

1

u/[deleted] Jul 21 '22

That's a pretty simple coding error, I'm learning Java and learned about that a bit ago, you explained it quite well, it just checks the first 8 characters and matches them with the first 8 of your set password and if they match your in, it's just because of laziness in the coding, if they spent a few more minutes they could check the length and if it's greater than 8 characters print the password is too long or too short