• BombOmOm@lemmy.world
      link
      fedilink
      English
      arrow-up
      83
      arrow-down
      1
      ·
      6 months ago

      Assuming the accounting system this thing links with both does not protect from SQL injection attacks (many don’t, despite it being easy to protect against) and also has a table named “Bills” with a field named “amount”; what this would do is go through every single Bills record and half the value in the amount field. This would completely fuck the system, particularly when it came to billing and tax filing as the numbers for accounts billing and receivable wouldn’t even come close to matching each other. The accounting department would have a hell of a time fixing the damage.

        • dfc09@lemmy.world
          link
          fedilink
          arrow-up
          17
          arrow-down
          1
          ·
          6 months ago

          I imagine they could if they knew exactly what you did and when, but if it doesn’t get discovered until later and nobody knows what happened, it would probably be a removed to figure out

          • T156@lemmy.world
            link
            fedilink
            English
            arrow-up
            8
            arrow-down
            1
            ·
            6 months ago

            It seems like it would be fairly easy to find. All you need to do is find out where the price drops massively, and work backwards from there, since it doesn’t change the code going forward.

          • SchmidtGenetics@lemmy.world
            link
            fedilink
            arrow-up
            5
            ·
            edit-2
            6 months ago

            Pretty sure it would be obvious to anyone working there that chicken tenders are $10 not $5. Even a quick glance at any single bill would show the issue.

                • Dr. Jenkem@lemmy.blugatch.tube
                  link
                  fedilink
                  English
                  arrow-up
                  3
                  arrow-down
                  1
                  ·
                  edit-2
                  6 months ago

                  No. The bill given to the customer would still show the correct amount.

                  And if anyone looked at previous bills from the backend, they would see normally priced chicken tenders. The total for the bill would be wrong though.

                  • SchmidtGenetics@lemmy.world
                    link
                    fedilink
                    arrow-up
                    2
                    arrow-down
                    3
                    ·
                    edit-2
                    6 months ago

                    Bill

                    2x orders chicken tenders $10 =20

                    Bill total $10 - 20/2 = 10…

                    Huh… I wonder what the issue is……

      • dan@upvote.au
        link
        fedilink
        arrow-up
        13
        arrow-down
        7
        ·
        edit-2
        6 months ago

        does not protect from SQL injection attacks (many don’t, despite it being easy to protect against)

        Every modern database library automatically protects against SQL injection, usually by using prepared statements (where the query with placeholders, and the placeholder values, are sent as two separate things). so a system would have to be written extremely poorly to be vulnerable to it.

        This post is just a joke as developers should hopefully be aware of the OWASP top 10 security vulnerabilities.

        Edit: Bad developers will do bad things, but any reasonable developer should be well aware of these risks.

    • Kerb@discuss.tchncs.de
      link
      fedilink
      arrow-up
      38
      arrow-down
      1
      ·
      edit-2
      6 months ago

      its an sql injection attack.
      its rather unlikely that it works in a modern app.

      assuming this would work,
      it injects a command in the sql database.

      it is assumed that the app runs a sql querry with the input field as a parameter e.g.
      INSERT INTO "bills" (item, ammount, tip) VALUES ("steak", "20,00 $", "content of the custom tip goes here");

      the semicolon indicates the end of the querry,
      so the the text would cause the app to run an unfinished querry, and then start a new querry that messes up the content of the bills table.

    • diffcalculus@lemmy.world
      link
      fedilink
      English
      arrow-up
      29
      arrow-down
      1
      ·
      6 months ago

      Nothing. For one, it won’t let you enter letters. Two, the table structure to these POS systems are more nuanced than a simple bills table with am amounts field.

      It’s amusing and all, but it’s not something you can do.

      Source: work with, and develop around, these types of POS systems.