• BombOmOm@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    8 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.

        • Mic_Check_One_Two@reddthat.com
          link
          fedilink
          arrow-up
          4
          ·
          8 months ago

          Yup. Rand() chooses a random float value for each entry. By default I believe it’s anywhere between 0 and 1. So it may divide the first bill by .76, then the second by .23, then the third by 0.63, etc… So you’d end up with a completely garbage database because you can’t even undo it by multiplying all of the numbers by a set value.

          • Buddahriffic@lemmy.world
            link
            fedilink
            arrow-up
            2
            ·
            8 months ago

            Also, by dividing by a number between 0 and 1, you increase the amount it looks like it billed. So income will look like it’s higher than outgoing funds, which will raise suspicions of embezzlement. And if someone actually is embezzling, whatever accounting tricks they’ve been using to hide it might just stop working because everything might need to be examined with a fine tooth comb. “Oh, the billing numbers aren’t right, and also it turns out the invoice numbers aren’t right either. Billing issue was tracked to a hack, but what’s going on with these invoices?”

      • dfc09@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        8 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 bitch to figure out

        • SchmidtGenetics@lemmy.world
          link
          fedilink
          arrow-up
          0
          ·
          edit-2
          8 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
                0
                ·
                edit-2
                8 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
                  0
                  arrow-down
                  2
                  ·
                  edit-2
                  8 months ago

                  Bill

                  2x orders chicken tenders $10 =20

                  Bill total $10 - 20/2 = 10…

                  Huh… I wonder what the issue is……

                  • Dr. Jenkem@lemmy.blugatch.tube
                    link
                    fedilink
                    English
                    arrow-up
                    1
                    ·
                    8 months ago

                    Yeah, obviously the issue can be discovered. My point is that it’s not going to be immediately discovered by the cashier or a customer. It’ll probably not get discovered until the accountant comes by and notices the discrepancy.

    • dan@upvote.au
      link
      fedilink
      arrow-up
      0
      ·
      edit-2
      8 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.