Unofficial Hacker News companion — get notified on comment replies, and more.

Credit card skimming scripts using WebRTC found on popular shopping sites (opens external site)

623 points by scanr 4 days ago | www.infohawk.com | 387 comments on HN | Vote on HN (opens Hacker News) |

View full thread · View on Hacker News

Comment thread (3)

  1. > Code to be executed is not data.

    Code is data. Executing code is displaying data, and displaying data requires executing code.

    > The store can send the shop's title and logo, some hero image, static images of each product, the price, if there was a discount, tax amounts, etc.

    We've already established you need to disallow SVG. JPEG XL is another widely supported TC format, so that goes as well. [1]

    > who would do the random network access

    As I already mentioned, suppose the shop wants to serve their logo or product images from a CDN, to spread the load geographically or something. That's either a "random" network access to a different server, or it's just not allowed for the shop to do that.

    > the price, if there was a discount, tax amounts, etc.

    The "etc." is doing a lot of work here. As you add more and more features, you'll end up implementing a DSL for specifying a price listing. Then you'll have to take some care to ensure it's not accidentally TC, if that's something you care about.

    Just because it's a fun thought experiment, suppose a shop wants to add an offer such as "buy 3 apples, get one free pear". If you allow that to your price list DSL, you've pretty much got a Petri net [2]. If you add precedence between offers (if both offer 1 and 2 apply, offer 1 is used), I think that would make it a Turing complete system, i.e. by designing the offers properly, the products you get at the end could be any function of the quantities of products you're buying. A silly example, but a fun one.

    [1] https://dbohdan.com/jpeg-xl [2] https://en.wikipedia.org/wiki/Petri_net#Extensions

    Replies (1)
    1. >Code to be executed is not data.

      Code is data.

      Pedantically yes. In every common sense notion we separate the two. Which is why Lisps make a great point of how they "uniquely" adhere to that (e.g. Rich Hickey "A fundamental feature of all Lisps, if they want to be a Lisp, is that code is represented as data."). A plain text is also a binary file, but we don't go around saying "plaintexts are binaries" because we understand the distinction given the context.

      For our purposes there is code, instructions in a programming language to be executed by the browser, and there is data, passive text or images that are just send be rendered.

      >We've already established you need to disallow SVG. JPEG XL is another widely supported TC format, so that goes as well.

      Fine by JPEG XL going too. And any other number of shit we don't need to have a bloody payment page. I'm not describing what is, but what could be, and be 1000 times safer than what we have.

      >As I already mentioned, suppose the shop wants to serve their logo or product images from a CDN, to spread the load geographically or something. That's either a "random" network access to a different server, or it's just not allowed for the shop to do that.

      Totally fine with this not allowed. Problem solved. The browser can cache it, and that's it.

      >The "etc." is doing a lot of work here. As you add more and more features, you'll end up implementing a DSL for specifying a price listing.

      Let's not add "more and more features" then. Keep it to the vast fewer features that work for 99% of store payment pages (or even cars) we've ever used.

      The rest can implement whatever custom solution they need, and be shown with a big "POTENTIALLY DANGEROUS" label slapped on them by the browser, same as it would do to a site with an broker certificate.

      >Just because it's a fun thought experiment, suppose a shop wants to add an offer such as "buy 3 apples, get one free pear". If you allow that to your price list DSL, you've pretty much got a Petri net

      Or you just allow them to send the state of the current list, and you return back the pear with it's price marked as zero.

      It's not rocket science. It doesn't need to be turing complete either to handle 95% of payment pages that exist (or 99.9999% if we go by popularity).

      Replies (1)
      1. The point of my examples isn't the examples themselves, but rather to illustrate that there's a bunch of complexity that you haven't thought about.

        Sure you can keep narrowing your spec as much as you want, but how can you be sure you've covered all "dangerous" (according to you) features? Perhaps there's another image format you need to forbid, how do you know?

        Also I'm VERY dubious of your 95% figure. I'd be surprised if more than 50% of current payment pages fulfilled your specs. Remember, you need to exclude any page that uses a SVG image, or uses a CDN for any image, or whatever else that you might later realize is "dangerous".

        And no, there's no intrinsic need for TC (nor an intrinsic need for non-TC), it just happens to be that a fully featured programming language is a very convenient way to handle complexity and configuration.

        It's in fact probably the more secure way to add configuration, because then the browser writers just need to implement and verify the interpreter of the language, instead of a bunch of arcane specialized components for whatever features a shop might need.

        And no, "just don't use those features", isn't a solution. There's a reason no shop in existence probably fulfills your requirements of being "secure", which is that the benefit is entirely theoretical, and the downside is that users want the features you exclude.