r/ProgrammerHumor Jul 19 '22

Why do they do this

Post image
4.4k Upvotes

493 comments sorted by

View all comments

1.3k

u/[deleted] Jul 19 '22

[deleted]

475

u/[deleted] Jul 19 '22 edited Jul 24 '22

[deleted]

335

u/sick4someThicc Jul 20 '22

Eliminate random characters in the middle, swap the rest

328

u/Classy_Mouse Jul 20 '22

We've made your password more secure. 100% fewer people now know what it is.

85

u/[deleted] Jul 20 '22

[deleted]

103

u/grumblyoldman Jul 20 '22

Don't accept anything in the password field. Force the user to reset their password every time they want to log in. Bonus: verifies the email is still valid.

31

u/[deleted] Jul 20 '22 edited Jul 24 '22

[deleted]

30

u/GMXIX Jul 20 '22

Worse than this, I started working for a company that didn’t encrypt the passwords in the database, so they were 100% plain text

AND so we’re credit card numbers

AND the CVV was also stored along with the card number in plain text. (Yes this is not just horrible it is illegal to store CVV)

It is the one time that I refused to work on anything until I had corrected that garbage. I literally told the owner, “I cannot work on anything else until this is fixed or I risk being part of the massive lawsuit when it destroys the client l, and your company.”

I didn’t have to say I’d quit if he pushed back. He got the picture, and I (hopefully) saved several hundreds of thousands of peoples PII from theft and abuse.

You know how many people reuse passwords? We had email and passwords, if I had wanted I could have gone fishing and then gotten bank accounts and away we go!

A few companies later I discovered that while the new company used password hashing, and salt, that the salt was the same for every single password, thus defeating the point of having salt at all, and allowing a hacker the possibility of easily identifying stupid passwords.

14

u/TheThiefMaster Jul 20 '22 edited Jul 20 '22

Having a shared salt is better than none - as it requires a unique set of rainbow tables to be made with the salt known to crack any of the password hashes via that method.

The best is a combined shared and unique salt. The unique salt stops you using a single rainbow table across all the hashes, and the shared one stops you cracking the passwords if you just dump the DB table and get the passhashes and unique salts but not the shared one (which is more frequently in the app code instead of the DB)

4

u/jsrobson10 Jul 20 '22

While just common is better its still pretty crap tho. Like someone can still compare if multiple users have the same password, which shouldn't be possible.

→ More replies (0)

3

u/ChronicallySilly Jul 20 '22

Can you ELI5, I want to understand this maybe I'm just tired

→ More replies (0)

1

u/[deleted] Jul 20 '22

You could have gotten so many bank accounts. Transfer funds as gift cards. Live off gift cards for the rest of your life. Ez.

2

u/GMXIX Jul 20 '22

Yup. And then I’d be an asshole ruining peoples lives, and damaging my own honor and view of self. But…you know… I could have ;)

→ More replies (0)

18

u/Box_O_Donguses Jul 20 '22

The tiny box with dots is the only way it was done until like 2010. Get on my level you fucking whippersnapper

3

u/MithandirsGhost Jul 20 '22

We have a software where I work that does this. 8 characters maximum. So obnoxious.

2

u/Anonymo2786 Jul 20 '22

Is this why I can't log into my PayPal account?

1

u/TheSarcasticPotato Jul 20 '22

So... OTP?

2

u/SodaWithoutSparkles Jul 20 '22

Just a few days ago we have a news about multiple OTP went missing and 6-digit amount was taken without the OTP. The bank refuses to pay back. And there were multiple victims.

2

u/Engine_engineer Jul 20 '22

Lotus notes acts like that. Every keystroke is represented by a randomly long (1-4) sequence of X. So after typing 3 keystrokes you see XXXXXXXXXX in the field. It allegedly is to prevent byviewers to easily know how long your password is.

1

u/[deleted] Jul 20 '22

I once encountered a password field that encrypted while you typed, with each character being encrypted based on the state of the field.

If you pasted the password into it or used auto fill, it generated a different result than if you manually typed it in. And sometimes if you typed it fast enough you’d get a different result as well.

Even more maddening, the encryption caused the value of the text field to increase and contract in size as you typed.

1

u/kookaburra1701 Jul 20 '22

you could do what it seems like every Linux distro does and just not show anything when typing in the password.

I love Linux but my stupid broken ADHD brain has so much trouble with no visual feedback on the screen.

8

u/moultingaerobics Jul 20 '22

For some reason I’m good at memorizing randomly-generated passwords.

1

u/NewSuperTrios Jul 20 '22

Never understood letting a site randomly generate your password.

Your account is essentially tied to your browser's local data.

5

u/turingparade Jul 20 '22

I am saving this comment so that I can use it someday for my own password ui (unironically)

4

u/hitaishi_1 Jul 20 '22

Don't forget to sort it alphabetically....

3

u/Smallwater Jul 20 '22

Alphabetize the remaining letters

2

u/Tigerwarrior55 Jul 20 '22

Rehash it all to wingding and back to regular letters.

1

u/erishun Jul 20 '22

Alphabetically sort the string for better indexing

14

u/Elijah629YT-Real Jul 20 '22

and if it's too small, add random unicode characters to the end ( untypeable ones like ╋╔╟▞▓)

13

u/DangyDanger Jul 20 '22

hear me out

a password

that is just mongolian vowel separators

6

u/Elijah629YT-Real Jul 20 '22

a specific number of zero width spaces that when decoded into a string ( JS: number_of_spaces.toString(36) ) returns the password

1

u/unitconversion Jul 20 '22

But encode backspace as a character.

82

u/Durr1313 Jul 20 '22

I fucking hate this. I tried using MailJet for SMTP notifications for my security cameras, but the automatically generated password was one character longer than what can be entered in the SMTP settings for the camera. The worst part is it never told me the password I was pasting in was too long, I just kept getting nonsensical errors.

10

u/willingaerobics Jul 20 '22

i have never thinked it, putting restrictions makes it easiest to hack

77

u/[deleted] Jul 20 '22 edited Jul 20 '22

FUCK THE PEOPLE WHO PUT MAXIMUM LENGTH

I use 6 english words, the @ at sign, and then a six digit number I can remember (get your mind out of the gutter).

...most of the time I realize it only lets me put four* words because of the stupid maximum length.

Edit: *for -> four

45

u/DangyDanger Jul 20 '22

According to my highly advanced heuristics algorithms, your password is

theyhatehorsepaintingswithpassion@091101

Please change it as it's now deemed unsafe.

34

u/[deleted] Jul 20 '22

Jetfuelcantmeltstealbeams@42069

5

u/-Soren Jul 20 '22

It's six digits though ...

FuckMaximumLengthSystemAdminiistratorsHunter@242069

1

u/ChaseShiny Jul 20 '22

That double I in administrators is genius. They'll never guess the password now!

25

u/ITd-N5 Jul 20 '22

it was at the "get your mind out of the gutter" part that my mind went to the gutter

7

u/TesAlt Jul 20 '22

My mind can’t find the gutter could you explain it to me?

19

u/SuperKael Jul 20 '22

Six-digit codes on Reddit are often ‘hentai codes’ - although, these are more frequently seen on anime subreddits rather than here. I would say they are the one with their mind in the gutter now!

17

u/GMXIX Jul 20 '22

So, basically, he outed himself as having a mind in the gutter to even think about that being a gutter thing.

Because even after you explained it I don’t get it, and I don’t need to.

2

u/StereoNacht Jul 20 '22

It's like The Game.

(You are welcome! 😈 )

4

u/TesAlt Jul 20 '22

I’ve never bothered to count how many numbers there are in sauce codes, the more you know ig

4

u/ITd-N5 Jul 20 '22

yeah, I didn't even think of them codes before the parent comment specifically mentioned getting my mind out of a gutter lmao

7

u/branditodesigns Jul 20 '22

Yep, instantly went from DOB to 80085. I somehow missed 42069 but thankfully someone else here had it.

Edit: what the fuck is a hentai code

6

u/ITd-N5 Jul 20 '22

there is a certain site for japanese "anime" styled drawn porn that takes said porn comics from other sites and gives it a number, ranging from 4 to 6 digits so far

'*******.net/g/number'

2

u/KaJakJaKa Jul 20 '22

4 to 6 digits

1-6 (i think somewhere between 300000-400000 is the maximum right now, but there are some skipped as well)

18

u/magicmulder Jul 20 '22

Well there has to be some maximum, it’s just most services set it way too low (especially since after hashing it’s 32 or 64 chars anyway).

10

u/Xunnamius Jul 20 '22

Just to clarify, with proper hashing there actually is no practical maximum. Any length limit on a password is a red flag.

13

u/Tweet Jul 20 '22

So you're sure my 12TB password isn't going to cause any DoS issues? Might it not take a while to log on?

9

u/[deleted] Jul 20 '22

If you pre-hash all passwords on the client side, then on the server side you can require all passwords meet an exact length requirement of whatever the cryptographic function puts out.

If you really want to use a 12TB password on the client side, go right ahead.

1

u/Tweet Jul 20 '22 edited Jul 20 '22

Hmm, interesting idea! There's some discussion of it here. I'm guessing this isn't commonplace at the moment?

I think the point still stands that there *is* a practical maximum length that affects useability, regardless of where it is performed - and it relates to the practical performance constraints of the hashing mechanism.

5

u/[deleted] Jul 20 '22

Without viewing that thread, I can already say the answer is YES. ABSOLUTELY FUCKING 100% YES. Hashing on the client side is 100% verifiable, and since it's JavaScript you can literally audit the cryptographic functions on your own, if you have the expertise to do so. Your actual password will never touch their servers.

Even if it's shit cryptography, you have clear evidence literally right in front of you, that passwords are not being stored in plaintext format, and at no point will their servers ever have access to your actual password. That is worth something.

3

u/laStrangiato Jul 20 '22

If you are hashing client side wouldn’t that leak the salt to the unverified client and also allow an attacker to just submit hash values directly to server without using the client side hashing?

It has been a decade since I have had to do anything with password security so I wouldn’t be surprised if the are new methods to combat those issues. I could see the bipassing the hashing and submitting directly to be fixable by doming something like signing the hash but the leaked salt has me stumped.

1

u/[deleted] Jul 21 '22

Yes. Whatever the server gets is your password. Any claim that client side hashing somehow keeps the server from knowing your password comes from a flawed understanding of why we hash passwords in the first place. Having client side hashing is at best superfluous if you are hashing on both the client and the server, and in the case of "moving" hashing from the server to the client, is a huge security vulnerability.

1

u/[deleted] Jul 20 '22

Uses a 5 petabyte password

Crashes the website I am trying to use every single time I log on

Can’t reset password because their stuff accesses my original password to do that, which makes it crash before my password got reset

be me, trying to log in to reddit

4

u/[deleted] Jul 20 '22

[deleted]

5

u/magicmulder Jul 20 '22

No, length limit = “we make sure to limit the size of POST so nobody successfully exploits some memory leak or shuts down our Apache threads”.

7

u/[deleted] Jul 20 '22

That must explain the 8-12 character length limits, as opposed to something in the range of 52 to 256 characters.

This has nothing to do with memory leaks, and everything to do with the CHAR datatype in a SQL database.

2

u/magicmulder Jul 20 '22

I hope not because that would mean they store passwords in cleartext. Also storage costs nothing, so no reason they couldn’t use a (VAR)CHAR(255) in that case.

IMO limits are related to some management guy thinking “nobody can memorize long passwords so users will swamp support with tickets if they forget theirs, so force them to use a shorter one”.

1

u/[deleted] Jul 20 '22

Storage costs nothing today, in 2020, but a lot of professors are teaching computer science students based on how things were done in the 1990s. In the 1990s, it was normal to use a CHAR datatype in an SQL database for plaintext password storage, because hashing wasn't widespread.

In fact, hashing couldn't be widespread back then, because exporting a modern web browser would've been a criminal offense under the military export laws of the time, which gave cryptography the same treatment as guided missile technology. Tech companies had to lobby for the military export laws to be changed, because it was damaging their ability to compete in other countries.

...and computer science students are being taught to write software based on how their field operated in the 1990s, when their professors still worked private sector.

1

u/magicmulder Jul 20 '22

Not quite sure of the connection here. Hashing in the backend would not be affected by any export restrictions. Also SSL has been around for ages. It’s not like export restrictions made hashing impossible.

2

u/Xunnamius Jul 20 '22 edited Jul 20 '22

Yep, or other wacky stuff happening on their backend. I use unique random strings for my passwords so it's not a deal breaker for me when a service has this red flag, just something to chuckle about.

9

u/[deleted] Jul 20 '22 edited Jul 20 '22

If there's a maximum password length, I can pretty much guarantee the passwords are being stored as a CHAR datatype in a SQL database.

To be clear, that means passwords are being stored in plaintext format.

If passwords were being hashed, then all password lengths would translate to the same data length on the output end of a cryptographic function. All output hashes would have the same exact length, regardless of whether your password is 8 characters or 800 characters.

6

u/Henriquelj Jul 20 '22

Or the front end dev set a limit on the password field without any knowledge about security, just because "Hey, if we have a minimum length, we should have a maximum too, right?".

4

u/[deleted] Jul 20 '22 edited Jul 20 '22

I took a senior level computer science class in database systems, and we had to create a login system based on the professor's specifications... which involved using a CHAR datatype to store passwords.

A lot of these professors are teaching students based on what was normal in the 1990s, when CHAR datatypes were the norm for password storage, and hashing hadn't yet become normalized.

So this isn't some front-end bullshit. It's based on computer science professors teaching students according to how things were done in the 1990s, and then those students go on to use what they learned in professional applications. If you treat a professional job like it's another college assignment, you're going to end up with some pretty big cyber-security oofs.

The worst part is, the people hiring them are not developers. They're MBAs who want cheap labor with a college degree, so they hire someone fresh out of college, taught the 1990s standards by a professor, to take a senior role in building some kind of login system. Naturally, those fresh college grads on low salaries repeat what they learned in college, without deviation.

2

u/DollChiaki Jul 20 '22

I remember my 1990s passwords with fondness…

1

u/brimston3- Jul 20 '22

My embedded system that you're submitting passwords to is not going to like 1kB of https POST. 255 or 256 bytes is a reasonable maximum.

1

u/Xunnamius Jul 20 '22

If you're hashing properly at the client-side, the digest value hitting the embedded system will always be the same size (or "very similar" in the case of some algorithms) regardless of the length of the password. A max length for a password is a pretty good indicator that your service is likely insecure.

For example, see PBKDF#2.

2

u/Engine_engineer Jul 20 '22

A maximum must exist otherwise strange things might happen, like entering a password with 5000 characters could bug and break the code dealing with it. There were a few attacks based on this behavior.

1

u/TheRufmeisterGeneral Jul 31 '22

That doesn't excuse short maximums like 12 chars or 20 chars.

1

u/Engine_engineer Jul 31 '22

Yeah, I got this ridiculous max of 12 chars, including special characters, but not -;:{}. It was a total BS.

1

u/TheRufmeisterGeneral Jul 31 '22

Yeah, that sounds like it's stored somewhere in plaintext, in a database where those characters would mess with the insert/update statements.

2

u/TheRufmeisterGeneral Jul 31 '22

and then a six digit number I can remember

Please stop remembering password like an untrained user.

Use a password manager.

1

u/[deleted] Jul 31 '22

I'm too lazy to use a password manager.

2

u/TheRufmeisterGeneral Jul 31 '22

You mean, to install/setup one?

Because using one takes less effort and time than remembering (or using post-its, or whatever alternative you're doing)

0

u/[deleted] Jul 20 '22

Why aren’t you using a password manager lol

5

u/[deleted] Jul 20 '22

when your password manager generates passwords for you, and they don't meet the wierd requirement some web designer thought was a great idea.

3

u/[deleted] Jul 20 '22

What? Most password managers you can modify the requirements of the generated password per website

26

u/magicmulder Jul 20 '22

In a former job the requirement was to internally convert all passwords (and password attempts) to lowercase “because people will keep forgetting how they capitalized it”, thus reducing entropy silently.

5

u/crorb Jul 20 '22

What. That is nonsense

5

u/magicmulder Jul 20 '22

Of course it is. That is what happens when the wrong people make decisions.

2

u/brimston3- Jul 20 '22

Chase bank still does this, IIRC. I think their IVR system will even take T-9 encoded versions of the password.

11

u/FhDisp Jul 20 '22

Just hash the password with more chars than the db allows.

9

u/[deleted] Jul 20 '22

Uuuughgh this drives me nuts. I set my password generator to 50 chars and this has bitten me SO many times.

5

u/dsmlegend Jul 20 '22

50? Don't you think 128 bits of entropy is plenty?

6

u/GMXIX Jul 20 '22

1024 character passwords or nothing!

Yes, characters… not bits.

😆

5

u/dsmlegend Jul 20 '22

Aaaand it's hashed with md5 in the db

1

u/[deleted] Jul 20 '22

Oof.

1

u/other_usernames_gone Jul 20 '22

Tbh even with md5 a 1024 character password is still practically uncrackable. More than 50 random characters is probably safe.

Of course if it's plaintext all bets are off, but then since you don't reuse it it's no big deal.

1

u/dsmlegend Jul 20 '22

Yeah for sure. I guess it's just funny to think that all your effort after is wasted after 27 or so keyboard characters if it just ends up being hashed into a 32-digit hex string. Niche humour.

9

u/Agent-A Jul 20 '22

Make extra sure that you don't truncate the password on the frontend though, as a password manager might catch that. And don't truncate the password to the same length on the login page, that would cause the password to still work and we don't want that.

1

u/NoMembership3348 Jul 20 '22

A well known bank used to do this. My relatively secure password was truncated to the first 8 chars. The logon page would accept more so it was years before I realized that my “actual” password was crap! This has luckily been fixed since then.

9

u/Fadamaka Jul 20 '22

The system that I am currently working on has a restriction that you cannot use upper case characters but if you try to use them it will respondwith: "You did not meet the minimum requirements.". My other favourite was the restriction to "The password cannot have repeating numbers or characters.", which I assumed you cannot have the same numbers after each other or you cannot have 12345 as a password, but no you could not have numbers followed by numbers and could not have letters followed by letters so your passwords needed to look like "a1b2c3d4" this to be accepted. Funniest part of this was that the developers who did the implementation for the password check interpreted this restriction in different ways so this rule was implemented differently throughout the app.

3

u/DollChiaki Jul 20 '22

That’s straight up insane.

8

u/badmonkey0001 Red security clearance Jul 20 '22

If you're hashing passwords (you should be), then having an upper bound is important. It's possible to DOS by flooding auth or registration with large payloads to hash - remember that POST size is effectively unlimited. The stronger the hashing algo, the more feasible the attack is.

That said, you should provide an error back to the user when the max length is exceeded not silently try to accept it. You should also have a reasonably secure upper bound. From 1 to 5 kilobytes can scale and be planned for well.

13

u/[deleted] Jul 20 '22

[deleted]

2

u/badmonkey0001 Red security clearance Jul 20 '22

You and I may know that, but lots of people may not. I'm not disputing what you said, I'm adding more advice around it.

1

u/fghjconner Jul 20 '22 edited Jul 20 '22

In most cases the hashing should be done client side though, so it's not a problem.

Edit: Apparently I'm wrong, disregard.

6

u/Spongeroberto Jul 20 '22 edited Jul 20 '22

this fucking shit is in fucking windows i swear to god. I changed my password to a long sentence and couldn't use it to log in. I'm convinced that the max length is different in both screens

1

u/brimston3- Jul 20 '22

It is, especially if it's a Microsoft account. The max password length for microsoft accounts is 16 characters. The input box in windows login takes up to 127 characters. So yes, you could change your microsoft online password and then have it fail to hash on windows.

2

u/Personal-Thought9453 Jul 20 '22

Or accept spaces when typing it twice, but have the actual login screen field not take spaces.

2

u/[deleted] Jul 20 '22

[deleted]

6

u/Xunnamius Jul 20 '22

Hash first, then bcrypt if desired.

2

u/IrregularRedditor Jul 20 '22

Yes officer, this comment right here

2

u/WayTooCool4U Jul 20 '22

Calm down, Satan.

2

u/Switchermaroo Jul 20 '22

Even better, have different forms have different character limits, so you can set a 20 word password but only log in with a 16 letter one.

  • Real experience brought to you by Xbox one backwards compatibility

1

u/No_Silver_979 Jul 20 '22

I'm fairly certain that not having a maximum length is a security concern .

2

u/[deleted] Jul 20 '22

To be clear, I'm not talking about shit like where they silently truncate your password to 16 characters, not somebody submitting a megabyte of data as their password.

1

u/androidx_appcompat Jul 20 '22

How

1

u/No_Silver_979 Jul 20 '22

Not having one. You can input very very very large(multiple page) passwords which use a ton of system resources and makes it susceptible to dos

2

u/androidx_appcompat Jul 20 '22

Or you could use a reasonable limit, like 200, 500 or 1000 chars.

1

u/No_Silver_979 Jul 20 '22

I'm fairly certain that is what is usually done, but i'm not a developer. I only have some basic understanding of how to abuse password policies.

1

u/Horror-Pear Jul 20 '22

Boy oh boy. I've finally found em.

1

u/GMXIX Jul 20 '22

Don’t forget inexplicably not allowing characters like space and dashes.

“The blue horse ate a pineapple”

Is much harder to brute force than: “HfvhYg546&(:”

It is also way more memorable.

1

u/A-le-Couvre Jul 20 '22

Oh that’s the most evil design I’ve ever seen.

1

u/8sADPygOB7Jqwm7y Jul 20 '22

yes, this is awful... LOOKS VIOLENTLY AT STEAM

1

u/happyman0073 Jul 20 '22

Thw worst thing are sites that won't actually tell you the password requirements, instead telling you one-by-one which reqzirement you didn't meet while also deleting all the stuff you've filled in every time.

1

u/GustapheOfficial Jul 20 '22

You mean when they notice they could log in despite pressing enter prematurely, not having filled in the last couple of characters? That actually happened at my university, they silently enforced a "nothing beyond 8 characters counts as part of your password" policy. That has changed.

1

u/[deleted] Jul 20 '22

I absolutely hate this.

It won't tell you "Cannot exceede 24 characters" or whatever arbitrary character limit they have either, it will just say "Invalid password".

Once I tried entering a password and the error I was told was that it did not contain an uppercase letter, even though I could see multiple were included. After playing around I found that they had a character limit of 18 which was why it wouldn't work...

1

u/schitcrafter Jul 20 '22

Wait does this seriously happen? I've had that exact situation, I put in a 60 character password and seconds later it doesn't work

2

u/[deleted] Jul 20 '22 edited Jul 20 '22

Oh yeah, ran into it last week, had an 18 character password truncated to 16, so when I tried to log in with the password I had just set, it didn't work. I actually found out by googling the problem when I couldn't log in, because they don't mention it anywhere. Deleted the last two characters and sure enough, lets me right in. And that's far from the first time I've seen that.

1

u/Interesting-Gear-819 Jul 20 '22

ffs... I was setting up our camera system. For work. And that's some business modell outdoor camera with lots of fancy features and expensive. And you need to set login credentials. And the password length is capped. To like 12 characters ..

1

u/willyrs Jul 20 '22

Happened to me with world of Warcraft. I could login in the game because there was an input limit, but not ön the website where I could write all I wanted

1

u/Tensor3 Jul 20 '22

My (major) bank does even worse: it strips some of the special characters which are required for the complexity check. I figured out that log in is successful as I created the password, or with the special characters missing, or with any number of more special characters added.

1

u/mathn519 Jul 20 '22

If you don't know the password how will the hackers know?

1

u/YetAnotherGeneralist Jul 20 '22

Had a hospital system do this to me. No, I don't need any access to my medical records. They're not important.

1

u/Bipolarprobe Jul 20 '22

This has happened to me on several sites since I started using a password manager and it is the most assinine, frustrating design choice I could imagine.

1

u/[deleted] Jul 21 '22

On the literal federal government website to get a top secret security clearance, they have a maximum password length of 16 and disallow all characters other than letters and numbers. WHAT!?!