• Americium (unregistered) in reply to Max
    Max:
    This actually sounds like everything worked as intended. Yes, there are technical problems, but...

    We're talking about an HR system. Which means people's private data. Which most companies are wary iof having internal IT able to view, as it allows IT staff to view everyone's salaries. So it is very common to outsource HR.

    Likewise, IT's job is not actually to make technical decisions. It is to make technical recommendations, then let management decide which is more important -- the technical needs, or the business needs. In this case, the business need for HR to be outsourced is more important to management than the technical issues.

    So yes, there are issues here. The biggest one being a lack of effort to find a better vendor. But it sounds like the evaluation process worked exactly as intended.

    It is absolutely IT's job to make technical decisions. That IT guy, Steve, reviewed the third party ASP code and found it be insecure.

    Why would HR prefer a third party insecure application to an in-house one? Sooner or later someone will break in and get those employee salaries.

    The third party wrote their ASP application without every seeing the data. So, Steve's team could also develop one based on some 1,000 fake employees in a SQL database.

    In any case, the HR website programming team never has to see the real employee data. Much software is developed using sample data before any real data exists. So, data security is not an issue.

  • Joe (unregistered) in reply to Been There

    It's a sql injection attack. http://en.wikipedia.org/wiki/SQL_injection

  • Downfall (unregistered)

    Hey, has anybody explained what an SQL injection attack is yet?? If not, please see http://en.wikipedia.org/wiki/Sql_injection_attack and http://xkcd.com/327/

    Thanks!

    CAPTCHA: Littlebobbytables.

  • (cs) in reply to Downfall
    Downfall:
    Hey, has anybody explained what an SQL injection attack is yet?? If not, please see http://en.wikipedia.org/wiki/Sql_injection_attack and http://xkcd.com/327/

    Thanks!

    CAPTCHA: Littlebobbytables.

    Thank goodness people are still explaining it here on the third page, so those who read the article and immediately jump to the last post will have a chance to understand.

  • (cs) in reply to Code Dependent
    Code Dependent:
    Downfall:
    Hey, has anybody explained what an SQL injection attack is yet?? If not, please see http://en.wikipedia.org/wiki/Sql_injection_attack and http://xkcd.com/327/

    Thanks!

    CAPTCHA: Littlebobbytables.

    Thank goodness people are still explaining it here on the third page, so those who read the article and immediately jump to the last post will have a chance to understand.

    WHOOOOOOOOOSH!

  • Trerro (unregistered) in reply to Barrett Jacobsen

    This is known as an SQL injection attack, and it's stupidly easy to defeat - simply make sure all special characters are escaped. Most scripting languages already have a built-in function for this, but for those that don't, it's trivial to write one.

  • MP (unregistered) in reply to Trerro
    Trerro:
    This is known as an SQL injection attack, and it's stupidly easy to defeat - simply make sure all special characters are escaped. Most scripting languages already have a built-in function for this, but for those that don't, it's trivial to write one.
    ^ TRWTF

    Late to the party and forgetting that proper storage of the passwords (encrypted or hashed) and/or proper usage of the database (stored procedure) would be better solutions.

  • Bobby Tables (unregistered) in reply to Voodoo Coder
    Voodoo Coder:
    That Troper:
    I get the concept of SQL injection, but I don't get how the "OR =" affects the SQL stuff.

    Yer doin it wrong.

    It's not "OR "="

    It's ' OR ''=''

    The difference: " != ''

    (double v single quotes...it is in effect saying OR BLANK SPACE IS EQUAL TO BLANK SPACE)

    Nope, 'Yer doin it wrong.'

    It is ' OR ''=' (as seen in code)

    The first apos. closes the first one in code, the one that still tries to close the first one after the password is concatenated will close the last one in the password text forming:

    ... password = '' or ''='' ...

  • Bobby Tables (unregistered) in reply to Bobby Tables

    edit should have put some spaces in there..

    ' OR '-'= '-

    roughly equals

    ' OR ''='

  • (cs) in reply to Technical Thug
    Technical Thug:
    Code Dependent:
    Downfall:
    Hey, has anybody explained what an SQL injection attack is yet?? If not, please see http://en.wikipedia.org/wiki/Sql_injection_attack and http://xkcd.com/327/

    Thanks!

    CAPTCHA: Littlebobbytables.

    Thank goodness people are still explaining it here on the third page, so those who read the article and immediately jump to the last post will have a chance to understand.

    WHOOOOOOOOOSH!

    WHOOOOOOOOOSH!

  • Roman (unregistered) in reply to Barrett Jacobsen

    It'll be true only if there're brackets like that: "...where username = '...' and (password = '' or 1 = 1)"

    It's MAGIC!

  • jonno (unregistered)

    so here's the bit's I get

    • no protection against SQL injection attacks
    • poor choice of DB and framework
    • pointless 'internal review' where the results get ignored.

    But I'm not sure i understand what the issue is with using the session object to cache user info? Isn't that what the session object is for?

  • (cs) in reply to AlpineR
    AlpineR:
    If so many sites fall prey to this kind of code injection, why doesn't the software treat outside stings as potentially poisonous rather than trusting them as much as the programmer-supplied strings? Shouldn't it treat outside strings literally, and limit expansion and interpretation to trusted stings?

    In general, the answer to this is one of two choices, depending on the programming language. If the code is written in anything but Perl[1], the reason is, "it wasn't written in Perl." If the code is written in Perl, the reason is, "it's a huge pain for the vast majority of programmers out there to successfully write an application that can work even with taint checking turned on - so they don't use taint."

    Also keep in mind, even if the code is written in Perl, and taint checking is turned on, there are a few ways one can use a tainted variable which is dangerous, but perl doesn't catch it, because to do otherwise would be so painful to both the perl maintainers and the people who use it that even fewer people would use it. For example, perl does not complain about using tainted arguments to system or exec[2].

    [1] I strongly suspect there's other languages which perform this kind of data source tracking, but I haven't heard of any.

    [2] It does complain about certain tainted environment variables (but not all). It also complains about single tainted arguments. However, if you're using the list versions of the builtins, it simply trusts that you know what you're doing.

  • (cs) in reply to Bappi
    Bappi:
    Is that the same Arthur Andersen that was involved, not just with Enron, but *every* major accounting scandal of the last twenty years?

    And now we know what caused all of said major accounting scandals! Poorly-written Access "applications"

  • (cs) in reply to MJB
    MJB:
    Of course not, but the developer probably copied the structure directly from a "Learn ASP in 24 H0urs!1!!!1 book -- From the chapter on how to retrieve records from a database.

    My predecessor did similar with the Remote Scripting (poor man's IE-only Ajax) used in one of the most buggy, poorly written cesspits of code I have ever seen; naturally it's the core of our business. He simply copied and pasted a tutorial on how to use remote scripting, and hacked around with the method code. He did not even bother to change the name of the method; the code does a product lookup and the method is named "getPeople" as it was in the tutorial.

  • (cs) in reply to jonno
    jonno:
    so here's the bit's I get - no protection against SQL injection attacks - poor choice of DB and framework - pointless 'internal review' where the results get ignored.

    But I'm not sure i understand what the issue is with using the session object to cache user info? Isn't that what the session object is for?

    The question is, how do you verify that the user is using the right session object? What is to stop the users from making changes to their session cookies in an attempt to gain the access of another active user? Most web developers I've encountered who use session cookies simply bank on the difficulty to change cookies (which is trivial) or the space between different active session cookies - and even web developers who personally use software similar to Firebug and have chosen sequential session cookies do this.

    I haven't seen the authoritative word on this, but I've seen a number of sites use a handful of cookies - for example, session id, username, and checksum/hash, and also use the person's IP address as an additional check. I've heard from some people that the best practice is to do that, but include the password in the hash calculation. I'm planning on checking into the actual best practice sometime before I develop an Internet accessible web page with logins.

  • Gary Olson (unregistered) in reply to Been There
    Been There:
    And our marketing people were infatuated with their marketing people.
    You didn't let them breed, did you?
  • katastrofa (unregistered) in reply to Shinobu
    Shinobu:
    if you're smart enough to be a programmer, you're probably smart enough to be scientist.

    LOL :)

    Programming is much easier than doing research.

  • jim steichen (unregistered) in reply to ObiWayneKenobi
    ObiWayneKenobi:
    Bappi:
    Is that the same Arthur Andersen that was involved, not just with Enron, but *every* major accounting scandal of the last twenty years?

    And now we know what caused all of said major accounting scandals! Poorly-written Access "applications"

    Oh, it's much worse than that! I was "Shanghied" into attending a training course for a MRP (Material Resources Planning) software system written by Arthur Andersen. I was a Quality Engineer at the company and it was deemed necessary that I be capable of performing audits on bills of materials produced by the system, etc. The course was for 3 8-hour sessions. In the first 20 minutes of the course, we were shown how to access an example MRP screen (think Green text on black background, i.e., no fancy Windows (TM) stuff!), fair enough, but the next screen to view some example inventory for the assembly had almost the same information as the previous screen, except it was completely re-arranged for some inexplicable reason. It was as if each user display of data was designed by a completely different person, located in their own separate cave in a galaxy far, far away. After the first thirty minutes, my brain went into stasis lock. I was supremely glad that I was not one of the poor schmucks that actually had to use said software day in and day out! Hallelujah!

  • David W. Fenton (unregistered) in reply to jay
    jay:
    Access is fine for an application that is going to run on the user's desktop, and only be accessed (no pun intended) by one user at a time.

    It's fine for small workgroups, too, not just single users. Of course, you have to be a competent programmer to create a multi-user Access app (using a Jet back end, of course, since Access wasn't involved in this WTF web app, only a Jet data store) that can be run by 25 or 30 people simultaneously.

    But using Access for a web application is crazy.

    Access can not be used for a web app. You can certainly use a Jet MDB as the back end for a website (not that it's advisable), but you certainly can't use Access. Access is an application development platform, for creating front ends to databases, and it won't be involved in any website whatsoever.

    Of course, the Access bigots always choose to elide the difference between Access and Jet, because it serves their purpose to ignore the fact Access is the best RAD database front-end development tool in existence, while Jet is merely a versatile file-based desktop database engine that doesn't scale well beyond a few dozen users without very careful application programming. It's the misuse of Jet in situations where it's not appropriate that gives Access its bad reputation among the Access bigots.

    But all they are showing when they badmouth Access is their complete ignorance of the product as a whole.

    -- David W. Fenton David Fenton Associates http://dfenton.com/DFA/

  • David W. Fenton (unregistered) in reply to Franz Kafka
    Franz Kafka:
    Doesn't access scale to 10 connections at most?

    No. Access can support thousands of users simultaneously, if the back end it's being used with supports that number of simultaneous users.

    Oh, you mean Jet? Or maybe you don't know the difference? Jet has a theoretical limit of 255 users on any MDB file, but the practical limit for anything other than read-only users is going to be substantially lower than that. This makes it a perfectly suitable data store for a very large portion of the universe of small workgroup apps.

    -- David W. Fenton David Fenton Associates http://dfenton.com/DFA/

  • David W. Fenton (unregistered) in reply to anonymous developer
    anonymous developer:
    well Access is just horribly inefficient with queries,

    Er, what? This is a ridiculous statement. I've had Access apps with a Jet MDB back end with hundreds of thousands of records in several related tables, and data retrieval was on the order of less than 1 second. The tables were properly indexed, of course, so Access/Jet could be efficient.

    Perhaps you don't know about indexes?

    the other saleability problem is that once you do queries on records that have thousands of rows it takes bloody long to complete, even if you are just doing a simple look up on a Primary Key.

    This is JUST WRONG except in the case of a badly designed schema with insufficient indexing, or simply bad SQL.

    Neither of your statements contains even the slightest bit of truth.

    Of course it's certainly possible to have problems like this if you don't know what you're doing, I guess.

    -- David W. Fenton David Fenton Associates http://dfenton.com/DFA/

  • CTO (unregistered)

    Seems like the CTO does not know the consequence of having a bad software deployed LOL. What a CTO (Cock Talking Officer? LOL)!

  • (cs) in reply to Zug
    Zug:
    The code they used would actually read:
    AND password_field = ' user_string ';

    So replace user_string with

    ' OR '' = ' 

    And you get

     AND password_field = ' ' OR ' ' = ' '; 

    In English, if the user's password from the database equals blank string OR if blank string equals blank string.

    Blank string always equals blank string. Therefore, access granted.

    For this to be the case surely they would have to add a space before and after the user's password when they store it (unencrypted and unhashed) in the database. I've never seen anyone do that. Is that how you normally do it?

    Of course, this would mean that the injection would also work in Oracle.

    Without the helpful additional spaces the original injection would NOT work in Orable because in Orable '' is replaced with NULL, and NULL != NULL.

    Just one of the many reasons why Access is better than Oracle.

    (Did I hear the troll siren going off a while back?)

  • Jerome Pineau (unregistered) in reply to Barrett Jacobsen

    I'm no security expert but I believe it's called SQL injection :)

  • Franz Kafka (unregistered) in reply to David W. Fenton
    David W. Fenton:
    Of course, the Access bigots *always* choose to elide the difference between Access and Jet, because it serves their purpose to ignore the fact Access is the best RAD database front-end development tool in existence, while Jet is merely a versatile file-based desktop database engine that doesn't scale well beyond a few dozen users without very careful application programming. It's the misuse of Jet in situations where it's not appropriate that gives Access its bad reputation among the Access bigots.

    But all they are showing when they badmouth Access is their complete ignorance of the product as a whole.

    -- David W. Fenton David Fenton Associates http://dfenton.com/DFA/

    No, what they're doing is reacting to the common case usage of access - some app written by a random guy in the office that's grown organically over years. Of course people react badly to something like that, and without clarifying statements, 'using access on the backend' is reasonably interpreted as using the Jet DB backend for some DB task. Sorry if we didn't use precise terminology.

    David W. Fenton:
    anonymous developer:
    well Access is just horribly inefficient with queries,

    Er, what? This is a ridiculous statement. I've had Access apps with a Jet MDB back end with hundreds of thousands of records in several related tables, and data retrieval was on the order of less than 1 second. The tables were properly indexed, of course, so Access/Jet could be efficient.

    Perhaps you don't know about indexes?

    1 second access time on a 100,000 rows with an index is godawful. i'd expect about 100ms response time for a decent table setup. And if you read the whole comment, he already had indexes on the table.

  • (cs) in reply to Connect to Reality
    Connect to Reality:
    Who actually uses Access, for anything?
    I use it, once or twice a year, because the consulting firm that I have to send data off to periodically for analysis insists on getting it in .mdb form. The process that generates the data dumps it into tables in our Oracle database and simultaneously to tab-delimited flat files to be loaded into Access. Then I spend a day or two putting it into the crazy format the consultants want. (I take a nice normalised format with two tables and turn it into a denormalised format with a separate table for each month, and then put each month's table into its own database. No, I am not making any of this up.)
    Matt:
    Can't say that this is really a "Curious perversion in IT". Where I work, it's more like "An everyday occurrence".
    Nobody ever said those terms were contradictory in any way. After all, this is the Daily WTF.
    Gary Olson:
    Been There:
    And our marketing people were infatuated with their marketing people.
    You didn't let them breed, did you?
    He recommended against it in the strongest possible terms, but was overruled by upper management after HR complained.
  • vlees (unregistered)
    ' OR ''='

    And that, kids, is why god invented hashing. (well amongst other reasons).

  • Level 2 (unregistered) in reply to vlees
    vlees:
    ' OR ''='

    And that, kids, is why god invented hashing. (well amongst other reasons).

    hashedpassword = hash_function(plaintextpassword) OR '' = '' is still always true.

  • Level 2 (unregistered) in reply to Gnubeutel
    Gnubeutel:
    I don't know whatever Microsoft abomination that code is, but...
    do
      //read row from user table
    loop
    
    Are they expecting to match more than one user?

    Well, select * from user_table where user_name = 'xxx' and password = 'yyy' or '' = '' will retrieve all the rows in useer_table.

  • Steve the Cynic (unregistered) in reply to woodle
    woodle:
    (Did I hear the troll siren going off a while back?)

    You did. I raised it, although the alleged troll pleaded not guilty.

  • michael (unregistered) in reply to Trerro
    Trerro:
    This is known as an SQL injection attack, and it's stupidly easy to defeat - simply make sure all special characters are escaped. Most scripting languages already have a built-in function for this, but for those that don't, it's trivial to write one.

    even better to use one that supports placeholders in SQL statements...

  • Golgo13 (unregistered) in reply to Barrett Jacobsen

    "Could someone explain why typing ' OR ''=' in the password field would give him access to anything? I don't see the magic happening there. :/"

    "Because the code that called the SQL they were using was probably along the lines of ...WHERE...AND [Password] = '" + string_user_entered + "'

    Which when inputed with ' OR ''=' results in the following SQL ...WHERE...AND [Password] = '' OR ''='' "

    ..but doesn't the article suggest that they're using Access rather than SQL?

  • (cs) in reply to Level 2
    Level 2:
    vlees:
    ' OR ''='

    And that, kids, is why god invented hashing. (well amongst other reasons).

    hashedpassword = hash_function(plaintextpassword) OR '' = '' is still always true.

    You joke, but see the following: SELECT 1 FROM users WHERE username = '%s' AND passhash = MD5('%s') with a username of "admin" and a password of "abc') OR ('0')=('0" (sans double quotes) (clue: it resolves to: SELECT 1 FROM users WHERE username = 'admin' AND passhash = MD5('abc') OR ('0')=('0'))

  • Anonymous Coward (unregistered) in reply to basseq

    Well you've certainly never worked for Accenture

  • Anonymous (unregistered) in reply to David W. Fenton
    David W. Fenton:
    <snipped general arrogant bullshit>

    http://dfenton.com/DFA/

    Hey, nice website. I can see you've got a lot of skill creating web content; after all, your website is a perfect mock-up of what a website would have looked like circa 1993. Who needs the WayBackMachine when they can hire the likes of you?

  • (cs) in reply to Wizard Stan
    Wizard Stan:
    As a current Accenture employee, I can safely say I've never seen anyone use Access. I've had people ask about using Access, and merrily told them "don't", but no one actually using it. I'm sure they're out there somewhere. On the other hand, I do routinely work with Sybase.
    From my own observations Accenture uses Excel for EVERYTHING! Need a bug tracker, use Excel Need a risk log, use Excel Need to document your class model, use Excel Need to wipe your nose, use Excel
  • Peter (unregistered) in reply to Scarlet Manuka
    Scarlet Manuka:
    I take a nice normalised format with two tables and turn it into a denormalised format with a separate table for each month, and then put each month's table into its own database. No, I am not making any of this up.
    At first glance, I read that as "...turn it into a demoralised format". Seems appropriate, somehow.
  • BC (unregistered) in reply to Anonymous
    Anonymous:
    David W. Fenton:
    <snipped general arrogant bullshit>

    http://dfenton.com/DFA/

    Hey, nice website. I can see you've got a lot of skill creating web content; after all, your website is a perfect mock-up of what a website would have looked like circa 1993. Who needs the WayBackMachine when they can hire the likes of you?

    See more WTF: http://dfenton.com/DFA/about.htm

  • (cs) in reply to David W. Fenton
    David W. Fenton:
    Access can *not* be used for a web app. You can certainly use a Jet MDB as the back end for a website (not that it's advisable), but you certainly can't use Access. Access is an application development platform, for creating front ends to databases, and it won't be involved in any website whatsoever.
    And Word 2007 is the front-end for doc, docx, rtf, txt, html and many many more
  • Scott is pissed (unregistered) in reply to bjolling
    bjolling:
    Wizard Stan:
    As a current Accenture employee, I can safely say I've never seen anyone use Access. I've had people ask about using Access, and merrily told them "don't", but no one actually using it. I'm sure they're out there somewhere. On the other hand, I do routinely work with Sybase.
    From my own observations Accenture uses Excel for EVERYTHING! Need a bug tracker, use Excel Need a risk log, use Excel Need to document your class model, use Excel Need to wipe your nose, use Excel
    No wonder they don't need me in the bathroom!
  • paritybit (unregistered) in reply to basseq
    basseq:
    "You’re telling me that Accenture routinely passes over databases like Oracle and SQL Server, and chooses instead to deploy their solutions using Microsoft Access?”

    “Yep,” Dave nodded, “they certainly do!”

    They certainly don't. Unless Dave's working, apparently.

    Lies! I always included Access in my technical designs while at Accenture. That way there was always an ongoing project to improve the stability of the application ;) Management love that sort of stuff!

  • jay (unregistered) in reply to MP
    MP:
    Trerro:
    This is known as an SQL injection attack, and it's stupidly easy to defeat - simply make sure all special characters are escaped. Most scripting languages already have a built-in function for this, but for those that don't, it's trivial to write one.
    ^ TRWTF

    Late to the party and forgetting that proper storage of the passwords (encrypted or hashed) and/or proper usage of the database (stored procedure) would be better solutions.

    Umm, how would encrypting the password prevent SQL injection?

    select userid from userlist where userid='myuserid' and password=encrypt('mypassword') or 1=1

    would still let me in, no matter how unbreakable the encryptian algorithm is. It's irrelevant.

  • jay (unregistered) in reply to Anonymous
    Anonymous:
    David W. Fenton:
    <snipped general arrogant bullshit>

    http://dfenton.com/DFA/

    Hey, nice website. I can see you've got a lot of skill creating web content; after all, your website is a perfect mock-up of what a website would have looked like circa 1993. Who needs the WayBackMachine when they can hire the likes of you?

    Hey, I don't know David Fenton from Danny Fenton [obscure allusion to a cartoon for those of you who don't have kids], but what exactly is wrong with his web site? Okay, aside from the annoying fact that he puts all the text in a narrow column, thus not using about half the screen and so wasting valuable screen real estate, and the rather cloying third-person description of himself on the About page. It is easy to navigate, and it contains the information that someone who might want to hire him would be likely to want to know.

    I've seen plenty of web sites that are filled with annoying animations and other fancy graphics that take forever to load and just waste my time. I like a site that's simple, clean, and to the point.

  • Still Not Tim (unregistered)

    I don't really understand how these situations occur, so I'm asking a serious question.

    In this scenario: 1: the software is buggy and insecure, in a way that can be recognised by almost anyone with relevant experience; 2: the IT department duly recommended against it - in writing... 3: someone with more authority than experience ordered it to be deployed anyway...

    Let's assume the app is compromised, and the result is one or more of: a: identity theft occurs b: employees are not paid that month c: cash is transferred from a company bank account d: some other event involving losses

    If and when that happens - isn't the person who ordered the deployment going to be held personally responsible ?

    There is a paper-trail, after all.

    If there isn't a specific individual accountable, then surely it becomes the collective responsibility of the board of directors ?

    And even if employees prefer to keep their head down and not make waves, what about the external investors ? Over-ruling expert advice to deploy a faulty system seems to run contrary to all notions of "best practise" and valid grounds for external investors to sue.

    Also, the fact that this scenario involves a system storing information that identifies specific individuals would make this - in various nations - a matter of criminal law, surely ?

    So, the serious question I'm asking is: Is the general problem here that: employees and/or shareholders know what is going on but if they talk, the fall-out will affect the company in general and although the guilty or incompetent would be dealt with, the innocent would likely also be out of a job, so they just shrug their shoulders and generally keep quiet...

    In other words - there are checks and balances in the system, but no-one is actually invoking them ?

  • (cs) in reply to Still Not Tim

    There are no checks and balances because the person with the authority is inundated from any repercussions due to seniority. Even if the IT department could show in writing that "Mr. Smith, CTO" approved the software despite the IT department's recommendations against it, "Mr. Smith" is senior management and can't be punished, someone else will take the fall for him.

  • (cs) in reply to Dave
    Dave:
    But surely ' OR ''=' would be hashed and compared to the hashed password stored in their database ...

    "HASH('" & password & "') = PWHASH" (the more natural way of typing it

    X') = 'X' OR 1 = 1 OR ('X

    HASH('X') = 'X' OR 1 = 1 OR ('X') = PWHASH

    or use "PWHASH = HASH('" & password & "')" X') OR 'X' = ('X PWHASH = HASH('X') OR 'X' = ('X')

    (of course, they should be doing the hash before they build the sql string - but how likely is that?)

  • JM (unregistered)

    “you’re telling me that Accenture [pass over] Oracle and SQL Server, and ... deploy ... [with] Microsoft Access?”

    “Yep ... they certainly do!”

    That explains a lot. I'm going for a lunch.

  • TrYde (unregistered) in reply to Barrett Jacobsen

    Good ol' SQL injection...

  • Christopher (unregistered) in reply to Barrett Jacobsen

    This is known as "SQL Injection".

Leave a comment on “Slow, Difficult to Code, and Buggy”

Log In or post as a guest

Replying to comment #:

« Return to Article