179 points

How to say you’re vulnerable to code injection without saying you’re vulnerable to code injection.

permalink
report
reply

Are they vulnerable though, if they already exclude it at the user input?

I yet have to learn SQL and is there a way to allow passwords with '); DROP TABLE… without being vulnerable to an injection?

nevermind i googled it, and there various ways to do so

permalink
report
parent
reply
51 points

This still smells though. Why is the raw, plain text password string getting anywhere near database queries in the first place?

permalink
report
parent
reply
18 points

I doubt it is. they probably have a WAF that blocks these strings though and didnt want to bother reconfiguring it

permalink
report
parent
reply
33 points
*

Prepared statements, mostly. You define the query using variables, turn that query into a language-dependent object, assign values to those variables, then execute the statement. The values will be passed verbatim, without any parsing.

Or, since we’re talking about a password, you could encode or encrypt it before inserting it into the query string. The fact that the website could be negatively affected by phrases in the cleartext password is very concerning.

permalink
report
parent
reply
8 points

At best, it means they’re storing your password instead of just a salted hash. And that’s horrible.

permalink
report
parent
reply
23 points

I noticed that upper case select, drop etc are not prohibited.

Poorly implemented user input filters are not a valid solution to being vulnerable to injection.

permalink
report
parent
reply
12 points

Good old Bobby Tables

permalink
report
parent
reply
9 points

No one in their right mind is storing plain text passwords, or letting them anywhere near the database.

You convert the password to a hash, and store that. And the hash will look nothing like the password the user typed.

permalink
report
parent
reply
12 points

You’re right. No one in their right mind would do that.

On the other hand, people not in their right mind often run things. Such as my old professional liability insurance. Which wrote the username and password in the yearly statements…

And also sent you the password through email if you forgot it…

Also you couldn’t change it…

permalink
report
parent
reply
3 points

Lol. Yes, people do still build systems and store plain text passwords. I regularly get scammers sending me my throwaway passwords from crappy sites. Good thing I never reuse passwords, or email addresses.

permalink
report
parent
reply
2 points

Parameterized queries.

permalink
report
parent
reply
1 point

🥲 t Yep it’s that easy to do the right thing

permalink
report
parent
reply
8 points

Maybe they filtered those strings to be safe, and put the notice there to answer the invertible “why won’t it accept my password” queries.

It’s a shitty password engine. But not necessarily uncleansed

permalink
report
parent
reply
6 points
*

If they’re trying to protect themselves from code injection by rejecting certain user input like that, then they don’t actually know how to protect themselves from code injection correctly and there may be serious vulnerabilities that they’ve missed.

(I think it’s likely that, as others have said, they’re using off-the-shelf software that does properly sanitize user input, and that this is just the unnecessary result of management making ridiculous demands. Even then, it’s evidence of an organization that doesn’t have the right approach to security.)

permalink
report
parent
reply
2 points

I don’t know, maybe they saw that classic XKCD comic and now they’re thinking “hahah, I’m wise to your tricks, ya little shit”

permalink
report
parent
reply
5 points

This is the result of some doc writer or middle manager not fully understanding what they’ve been told.

permalink
report
parent
reply
58 points

Oh BobbyTables, you little rapscallion…

permalink
report
reply
57 points

Little Bobby drop tables

permalink
report
reply
53 points

So they’re not hashing or salting the passwords too. Cool…

permalink
report
reply
17 points

They might be doing it in the DB query, but they’re definitely not sanitized beforehand.

permalink
report
parent
reply
2 points

Sanitization has nothing to do with salting and hashing.

permalink
report
parent
reply
2 points

If you do the salting and hashing in a database query you need to sanitize the input before you use it or you open yourself to SQL injection.

Databases have salting and hashing functions, after all

permalink
report
parent
reply
9 points

Which makes me want to try and insert a password of a few megabytes worth of text. Should be fine, since there is no max lenght defined, right?

permalink
report
parent
reply
4 points

If there is no overwrought prohibition of something I know that at least in America that means it’s

  1. Affirmatively legal and
  2. Legislatively encouraged by the FREEE Act

So give ’em hell!

permalink
report
parent
reply
1 point
*

That’s not how it works. The code always has access to the submitted plaintext password. It’s salted and hashed after it’s verified for complexity. The complexity verification can even be done in JavaScript.

permalink
report
parent
reply
46 points

Obligatory Little Bobby Tables: https://xkcd.com/327/

And for those who feel like saying they’ve already seen it: https://xkcd.com/1053/

permalink
report
reply

Cybersecurity - Memes

!cybersecuritymemes@lemmy.world

Create post

Only the hottest memes in Cybersecurity

Community stats

  • 563

    Monthly active users

  • 80

    Posts

  • 1.2K

    Comments