Live data from Hacker News

Password may not contain: select, insert, update, delete, drop

id.uni-lj.si

61–70 of 254 posts

Re: Password may not contain: select, insert, update, delete, drop

#61

I expect this will attract a lot of criticism, but I actually think it's a good idea, at least in some cases. There are a lot of people writing bad code and bad system architectures for their organizations. There are not enough people with the competence, organizational power, and time to catch what's bad and force change in those organizations. In the US you are probably forced to do business via many such terribly…

But why would you ever send a plaintext password into a sql query?

Re: Password may not contain: select, insert, update, delete, drop

#62
post #54
post #44

Earlier quoted context omitted.

Nope - that's not a valid ldap URL - or even a valid domain, for that matter. Domains can only contain the ascii leters a-z and the digits 0-9 -- asterisks are not permitted; the only symbol permitted is a hyphen (and it cannot start or end with one).

It's a log4shell reference

But you missed the actual joke.

Re: Password may not contain: select, insert, update, delete, drop

#63
post #41

Earlier quoted context omitted.

That would imply WAF gets to see unhashed passwords, so not good at all.

How would a WAF do its job if it can't see the request payload?

There are various schemes where the password is salted, hashed or prehashed on the client side, to various effectiveness. They have never been really popular and the advent of ubiquitous https probably made them even less common, but they do exist. They do help protect you from your own WAF though.

Re: Password may not contain: select, insert, update, delete, drop

#64
post #33

still better than "password used by another account"

Not sure if serious. We need this. If you can guess someone else's password by accident, both of you need a password reset and that password needs to go on the denylist.

Modern advice for strong passwords is having a length requirement and checking the input against a list of known passwords, for example using the HIBP partial hash API. (Any time you see forced expiration or complexity requirements, you're dealing with a legacy/cargocult system.)

Re: Password may not contain: select, insert, update, delete, drop

#65
post #61

I expect this will attract a lot of criticism, but I actually think it's a good idea, at least in some cases. There are a lot of people writing bad code and bad system architectures for their organizations. There are not enough people with the competence, organizational power, and time to catch what's bad and force change in those organizations. In the US you are probably forced to do business via many such terribly…

But why would you ever send a plaintext password into a sql query?

Because you are lazy, irresponsible, and/or incompetent.

Re: Password may not contain: select, insert, update, delete, drop

#66
post #62
post #54

Earlier quoted context omitted.

It's a log4shell reference

But you missed the actual joke.

Indeed. I wasn't sure if you weren't aware of the log4shell reference or if I was majorly missing your point. The latter, then!

Re: Password may not contain: select, insert, update, delete, drop

#67

I expect this will attract a lot of criticism, but I actually think it's a good idea, at least in some cases. There are a lot of people writing bad code and bad system architectures for their organizations. There are not enough people with the competence, organizational power, and time to catch what's bad and force change in those organizations. In the US you are probably forced to do business via many such terribly…

If an organization has such a password policy, that can be interpreted as the person in charge of setting this policy thinks their organization doesn't have enough people with the competence and organizational power to prevent SQL injection vulnerabilities. Which would reflect poorly on any institution, but especially a university (which should be a bastion of people with competence and organizational power). As for…

It can be interpreted as you suggest, but does not necessarily come from the person in charge. It might mean that auditors forced the installation of a WAF because of $REGULATIONS (irrespective of the actual code quality) and refused to allow weakening the rules for password fields.

EDIT: as they don't actually check for all the banned strings, the "auditor + mandatory misconfigured WAF" hypothesis expressed above is not valid in this case. But let it stay as an otherwise-plausible explanation, or maybe something that was valid in the past.

Re: Password may not contain: select, insert, update, delete, drop

#69
post #42

Obligatory meme-y "tell me you're not sanitizing input without telling me". Also not storing hashes of passwords, because then it wouldn't matter what the input is.

Thinking about it, it can also be that the input is sanitized a little too much. Imagine the user uses "select_mypassword" as a password. The sanitizer kicks in and silently mangles your password, resulting in another password being stored than the one you entered, effectively locking you out. Or maybe it just fails with an obscure error because some overzealous countermeasure triggered. I wonder what using the EICAR…

Presumably you would apply the same sanitizer at login time to whatever password the user enters. If the input is the same and the transform is the same then the output will be the same.

Hopefully you don't actually have to do any of this because your backend wasn't written by monkeys on typewriters.

Re: Password may not contain: select, insert, update, delete, drop

#70

I want more innovation in the password requirement genre: Your password must be valid SQL, Java, Go, or C++ string. Or a haiku about grocery shopping. This way it won’t look like a password in case we leak it.

It's pretty common to force usernames to be valid C or Pascal identifiers (only letters digits and underscores, first character can't be a digit). So why not extend the reasoning to passwords. /s
Post reply on HN