- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
TRWTF is that most of the people in the comment section can't understand a simple block of code...
Also, notepad. Also the submitter's actions. Also the insufficient details from the OP to understand what really happened.
WYSIWYG editors are for lusers. ;)Admin
Admin
Admin
Admin
So...ummmm...where's the WTF? Any third-party software sales rep will tell you the only thing that matters is the clean, beautiful, creative, and unique, user interface.
Reliability? It's reliably pretty! Correctness? It uses all the best grammar! Security? Yes, it has a password field. Quality? Just see that beautiful flashing display!
Ignore the man behind the curtain...
Admin
TRWTF is that the OP made up the bit about the SQL injection attack demonstration, to spice up the story, and is now too proud to remove it. The story and the code do not match.
Admin
Wow, I can't believe I forgot this reference until now:
"Security is for closers."
Admin
Right, so how exactly did he know to type "star" as the password when he typed "' OR 1=1;--" as the username?
He claimed to have a working proof of concept of the vulnerability just by typing "' OR 1=1;--" in the username field. How could he possibly have gotten that result if he didn't know to type "star" in the password field?
Admin
The only editors that are hard to do anything properly in are those that don't support my WITIWIM attitude.
Admin
TRWTF is the number of people commenting who like the OP don't seem to understand how SQL injections actually work.
Admin
Made-up story is made-up.
Made-up story implies that injection was discovered, yet the code permits successful authentication only if the password submitted == 'star'.
What's the likelihood that a password was even submitted when the injection string (submitted as the user name) closes the SQL statement?
Made-up story is made-up.
Admin
Honestly, Lorne, you should have just posted the damn code snippet and left the story in your WYSIWYG editor. #storyfail
Admin
Holy (fuck) that (was) annoying (to) read.
Admin
No, look at it carefully. It didn't check the username and password that were entered, at all. If anyone in the database had the right password, the login would be successful. The stock SQL injection trick worked, but it only worked by accident because any login would have worked.
Admin
I saw that at least one other person caught the fact that the MoveNext is OUTSIDE the loop.
Admin
No. I saw indentation. I didn't get what I saw.
Admin
If the submitted password is equal to 'star'. It's very clear, no?
Admin
If the submitted password is equal to 'star'. It's very clear, no?
Admin
Admin
Whether the story is true or not, I am curious to see how it ends. Will our stalwart hero convince the Judy S. Kirkland (5 Star something-or-rather) to upgrade the website security? Will the project become an entirely new WTF? Or will one of the other Super-Realtor-Villans take the #1 spot?
Stay tuned! Same WTF-Time, Same WTF-Channel.
Admin
Admin
Don't forget:
Admin
How does this confuse you all so much?
This: If Request("Password") = "star" Then
IS ALWAYS TRUE.
Admin
No. Here, as a conditional statement, the equality sign means equality and not assignment.
Admin
Admin
"[b]Not[/] a proof of concept (successful login with username: ' OR 1=1;--) "
There was no proof of concept (that would usually test something like .....)
Admin
Admin
This is one of the rare cases where Basic is actually superior to C++; another is Select Case vs. switch.
Admin
Decline of TDWTF comments. WTF you guys
Admin
Admin
Fail. (Blah Blah Blah Blah Blah).
Admin
But what does it mean to be "logged in" ?
Maybe having a "star" in the passwords just means that the website works. Remove the star and the site is disabled.
Admin
Admin
I think the badness here is exaggerated a lot
Admin
I think with Real Estate sites, one of the reasons is so you can set up monitors on properties of interest...Useful? Probably not, but I can sort of see why people would do it...
Admin
For those that aren't familiar with ASP, the Request object has five collections:
So to properly pull from a form field, you would use this:
And to pull from a URL:
I know that Request("Password") will pull from the Form and QueryString collections, not sure which of the other three it could pull from.
Either way, not a huge security risk, just sloppy. I definitely have the feeling that this is another case of someone who "likes" computers trying programming, and creating code that shows the wide divide between knowing how to get something working, and doing a job correctly.
Admin
Admin
Let me join the war too...
I suspect what might have happened is....
Real Acetate agent is logged in.
Emmet does his 'SQL Injection test' Emmet assumes (since the Session hasn't actually loggerd out with the new login attempt) that his SQL Injection works Emmet discovers about 500 WTF's in 5 lines of code....
Let's recap
Admin
So many people not grasping the facts. A few that do.
the RS.MoveNext is inside the loop, it's the crappy indentation that's throwing anyone who believes otherwise
it's not comparing against any field in the recordset, it's comparing the Request Form/Querystring variable "password" for the value "star". The recordset enumeration is pointless. As there's no querying or modification using any parameters from the user, it's most likely immune to SQL injection, assuming there are no unicorns or rainbows.
ASP (which, server-side uses VBScript) does not have = and == for assignment and comparison, only = which does both depending on context
Request("Password") - if you omit the collection name to enumerate from Request, then ASP will enumerate ALL collections in this order: -
This is a WTF (in my opinion) on ASP's part; good practice would IMO be to always be explicit and not really on magic to handle defaults.
I think the intention is to capture it from either the form or querystring, form most likely.
TRWTF is most of the responses here.
That is all.
Admin
The database query IS used, it makes the page take a little bit longer so that it looks like it's thinking, enhancing the user experience. :)
Admin
Also, if the recordset is empty, then login fails regardless of the password.
Admin
You really can't follow a simple loop stepping through a SQL result set?
Admin
Admin
I like Java PreparedStatement, it atleast save from this SQL Injection
Admin
Imagine this being replaced by Times Roman Regular – what a thought, no more Most Requested Upper Echelon Realtor Website of the Year (2012)!
Admin
Man, I'm an idiot. Damn you horrible indentation!
Admin
Real estate people, where to begin. A while ago (it was around 15 years ago) they setup the local MLS to have pictures. The IDs were 9 digits long, and they had a special program that would take any bunch of text and find the 9 digit numbers then fetch pictures. Of course they had to have their own private network that you needed to dial in (no internet, to unsecure!) so it involved specialized programs. They all worked well until the 9 digit field overflowed and they started using numbers starting with zero. Then they didn't have 9 digit numbers any more and it all failed. Oh, well.
Bunch of "self important" people.
Admin
Yes, bookmarking the url that has the password is bad. Anything entered in the log in fields will log you in. But no one has mentioned, you might as well bookmark /realtor_home.asp and completely skip the log in screen. That's Real Security. Google has probably already indexed the "secure" page and has it in search results with a direct link :)
Admin
Ok, TRWTF is the story.
The Proof of concept wouldn't work against the offending code as presented at the end of the article; ever. The SELECT query was doing nothing regardless.
I suppose the other WTF's were everyone tripping over assignment and equality in the vbscript or mistaking request("password") for something like rs("password").
If we are to believe that the block of code presented at the end of the article is the solution that the developer came up with then we have another RWTF and that is this guy writing code. A better solution would have been to use request.form() to prevent query stirng submissions, write a function to sanitize anything that hits the database and use stored procedures and tokens instead of SQL queries.
Admin
So why exactly is Pachelbel's Canon etc. supposed to be a WTF?