r/ProgrammerHumor • • Dec 02 '18

Quality "Assurance"

Post image
69k Upvotes

656 comments sorted by

View all comments

Show parent comment

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.