Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Textbook security

Textbook security

Scheduled Pinned Locked Moved The Lounge
databasesecurity
16 Posts 14 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Pascal Ganaye

    :~ This morning I found a piece of code

    sql = "SELECT * FROM USER WHERE USER=\"+textBox1.Text+"\"";

    The software had passed a big security check earlier last year... Shall I cry and get burned, silence and chuckle.

    OriginalGriffO Offline
    OriginalGriffO Offline
    OriginalGriff
    wrote on last edited by
    #6

    Talk to your boss. If that POS got through a security audit then the whole audit is flawed and there may be much worse stuff in there. Presumably, you hold security checks for a reason - that you need to be at least reasonably secure - but someone has not done their job at all well, and needs "education" on his or her role in the company. Or a P45.

    If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.

    "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
    "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

    P 1 Reply Last reply
    0
    • A Abhinav S

      Pascal Ganaye wrote:

      sql = "SELECT * FROM USER WHERE USER=\"+textBox1.Text+"\"";

      Just request the testing team to type 1;drop table USER in the textbox and watch all the fun. :-D

      WP Apps - Color Search | Arctic | XKCD | Sound Meter | Speed Dial

      V Offline
      V Offline
      V 0
      wrote on last edited by
      #7

      If it's SQL Server, this might even be better:

      EXEC sp_MSforeachtable @command1 = "DROP TABLE ?"

      Which drops ALL tables :-) (PS: found it on a quick google and have no desire to test this...)

      V.
      (MQOTD Rules and previous Solutions )

      1 Reply Last reply
      0
      • OriginalGriffO OriginalGriff

        Talk to your boss. If that POS got through a security audit then the whole audit is flawed and there may be much worse stuff in there. Presumably, you hold security checks for a reason - that you need to be at least reasonably secure - but someone has not done their job at all well, and needs "education" on his or her role in the company. Or a P45.

        If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.

        P Offline
        P Offline
        Pascal Ganaye
        wrote on last edited by
        #8

        You're all right. I made an email to management.

        1 Reply Last reply
        0
        • P Pascal Ganaye

          :~ This morning I found a piece of code

          sql = "SELECT * FROM USER WHERE USER=\"+textBox1.Text+"\"";

          The software had passed a big security check earlier last year... Shall I cry and get burned, silence and chuckle.

          B Offline
          B Offline
          BobJanova
          wrote on last edited by
          #9

          If that's anywhere where a malicious user can get at it, i.e. a public system or a system available to all employees, then imo it's serious enough that you should raise it even if it causes some significant inconvenience for you to go through the process. Not only is it a huge data security hole in the application, but it shows significant failings on the part of the security auditors. If they were external you might even have a good case for getting some money back on the basis that they didn't do the job you paid them for, and if they were internal then they clearly need discipline and/or training for not doing their job to a professional standard. There's bad code everywhere which is amusing to look at and that's fine. But when it goes to the level of SQL injection vulnerabilities then someone needs to fix it and make sure it doesn't happen again.

          1 Reply Last reply
          0
          • P Pascal Ganaye

            :~ This morning I found a piece of code

            sql = "SELECT * FROM USER WHERE USER=\"+textBox1.Text+"\"";

            The software had passed a big security check earlier last year... Shall I cry and get burned, silence and chuckle.

            J Offline
            J Offline
            Jorgen Andersson
            wrote on last edited by
            #10

            The obligatory XKCD[^] reference.

            "The ones who care enough to do it right care too much to compromise." Matthew Faithfull

            G 1 Reply Last reply
            0
            • J Jorgen Andersson

              The obligatory XKCD[^] reference.

              "The ones who care enough to do it right care too much to compromise." Matthew Faithfull

              G Offline
              G Offline
              glennPattonWork3
              wrote on last edited by
              #11

              When I saw this post, I was looking for that very XKCD you beat me! :)

              1 Reply Last reply
              0
              • P Pascal Ganaye

                :~ This morning I found a piece of code

                sql = "SELECT * FROM USER WHERE USER=\"+textBox1.Text+"\"";

                The software had passed a big security check earlier last year... Shall I cry and get burned, silence and chuckle.

                K Offline
                K Offline
                kris allberry
                wrote on last edited by
                #12

                OK so this is very wrong in every sense BUT: this SQL wont work if you look closely! you have a double quote at the end of the textbox (\") and not at the start, just a random '/' this will never work. (or are you making this up for a troll response)? alternativly, the last quote is fake or left because you doctored the SQL for us mere mortals, and potentially your after a number only. so "SELECT * FROM USER WHERE USER="+textBox1.Text; this is for only a number (as any string will make the SQL fail) so only a number will work, and the textbox will have to have been validated to only accept a number and therefore you wont have a problem as you cant SQL inject with only a number! i recon you are either trolling, or have not looked close at this, as if you even had 1 char in this SQL it will fall over. You my friend are a FAIL.... sorry! (P.S.... never ever write SQL's like this...)

                J 1 Reply Last reply
                0
                • K kris allberry

                  OK so this is very wrong in every sense BUT: this SQL wont work if you look closely! you have a double quote at the end of the textbox (\") and not at the start, just a random '/' this will never work. (or are you making this up for a troll response)? alternativly, the last quote is fake or left because you doctored the SQL for us mere mortals, and potentially your after a number only. so "SELECT * FROM USER WHERE USER="+textBox1.Text; this is for only a number (as any string will make the SQL fail) so only a number will work, and the textbox will have to have been validated to only accept a number and therefore you wont have a problem as you cant SQL inject with only a number! i recon you are either trolling, or have not looked close at this, as if you even had 1 char in this SQL it will fall over. You my friend are a FAIL.... sorry! (P.S.... never ever write SQL's like this...)

                  J Offline
                  J Offline
                  Jeremy Hutchinson
                  wrote on last edited by
                  #13

                  Also User is a keyword in SQL, so you can't just select * from User, you have to select * from [User] (World, please stop naming tables with reserved words)

                  My Blog[^] Chess Tactics for WP7[^]

                  K 1 Reply Last reply
                  0
                  • J Jeremy Hutchinson

                    Also User is a keyword in SQL, so you can't just select * from User, you have to select * from [User] (World, please stop naming tables with reserved words)

                    My Blog[^] Chess Tactics for WP7[^]

                    K Offline
                    K Offline
                    kris allberry
                    wrote on last edited by
                    #14

                    Good spot, i didnt even pick up on that (My Fail)... (would have needed a 'dbo.' too.)!

                    1 Reply Last reply
                    0
                    • P Pascal Ganaye

                      :~ This morning I found a piece of code

                      sql = "SELECT * FROM USER WHERE USER=\"+textBox1.Text+"\"";

                      The software had passed a big security check earlier last year... Shall I cry and get burned, silence and chuckle.

                      R Offline
                      R Offline
                      RafagaX
                      wrote on last edited by
                      #15

                      Well that was last year, or hasn't been modified until now?

                      CEO at: - Rafaga Systems - Para Facturas - Modern Components for the moment...

                      1 Reply Last reply
                      0
                      • P Pascal Ganaye

                        :~ This morning I found a piece of code

                        sql = "SELECT * FROM USER WHERE USER=\"+textBox1.Text+"\"";

                        The software had passed a big security check earlier last year... Shall I cry and get burned, silence and chuckle.

                        T Offline
                        T Offline
                        thewazz
                        wrote on last edited by
                        #16

                        keep us posted on how it's dealt with. could be interesting on many levels.

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups