r/ProgrammerHumor • • Dec 02 '18

Quality "Assurance"

Post image
69k Upvotes

656 comments sorted by

View all comments

4.9k

u/GrizzledBastard Dec 02 '18

Yes I’ll take one ‘); DROP TABLE outstanding-tabs;

1.5k

u/[deleted] Dec 02 '18

One Bobby Tables, comin' right up!

525

u/drakeblood4 Dec 02 '18

Then the bartender pours you a tall glass of bleach.

460

u/Steampunkery Dec 02 '18

Taking sanitized inputs to another level

130

u/redlaWw Dec 02 '18

But that's a sanitized output?

0

u/[deleted] Dec 02 '18

[deleted] — view deleted comment

28

u/l27_0_0_1 Dec 02 '18

That's why it's next level.

→ More replies (1)

250

u/Lord_Wither Dec 02 '18

320

u/ILikeSugarCookies Dec 02 '18

Is it “obligatory” when that was directly referenced?

112

u/[deleted] Dec 02 '18

There's probably an XKCD for this too

72

u/protokoul Dec 02 '18

Is this what meta feels like?

→ More replies (16)
→ More replies (9)
→ More replies (2)

188

u/StarkRG Dec 02 '18

Sorry, mate, we sanitize our orders here.

→ More replies (1)

61

u/MrShlash Dec 02 '18

I’m curious, why didn’t you add —— after the semicolon?

94

u/redlaWw Dec 02 '18

So it crashes when it tries to find outstanding-tabs in the remaining SQL.

I don't know anything about databases please don't hurt me

105

u/MrShlash Dec 02 '18

Adding two dashes at the end makes the rest of the sql code a comment that doesn’t execute.

Whenever I saw an SQL injection joke around here they don’t use the dashes and that confuses me, is there a benefit to ending with a semicolon?

57

u/burningpineapples Dec 02 '18

We have a database we use for development at work. I'm totally trying this tomorrow.

146

u/[deleted] Dec 02 '18

Hint: don’t

97

u/[deleted] Dec 02 '18

Jeremy Clarkson's voice: But he did

7

u/VAShumpmaker Dec 02 '18

Th' Moanstah... unda tha baun-et

7

u/WinstonWelles Dec 02 '18

I'd never seen a phonetic transcription of Arnold Shwarzenegger doing an impression of Jeremy Clarkson before. Reddit is amazing.

→ More replies (1)

21

u/Bojangly7 Dec 02 '18

Don't mess with work databases that's a good way to find yourself out of a job.

15

u/LordAgbo Dec 02 '18

Also, you’re 2 or 3 terminal commands away of getting a local database to mess up all you want. Look “docker” up. You’re welcome.

→ More replies (3)
→ More replies (3)

15

u/redoverture Dec 02 '18

Your code won’t be valid unless it’s there. Same reason the injection starts with ‘);’. You’re inserting code where an input should be.

input( var ) ... some other code ... is exploitable

input( ); DROP TABLE table; ) ... some other code would throw errors and likely not do what you want it to do

input(); DROP TABLE table; — — ) ... some other code ... keeps everything ‘happy’ and exploits the query.

→ More replies (6)
→ More replies (1)
→ More replies (15)
→ More replies (4)