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)

624 points by scanr 5 days ago | www.infohawk.com | 390 comments on HN | Vote on HN (opens Hacker News) |

View full thread · View on Hacker News

Comment thread (11)

  1. > allow strangers to run random code on your computer

    > deliver just data and my browser decides what to do with it

    Code is data and your browser decides to execute it. A toy example, but HTML+CSS is Turing complete. The problem thus isn't that it's "code", but rather that it's not properly sandboxed.

    > my shop browser decides how to operate with the catalogue in a way I want

    Are you making a case for built-in components for e.g. sorting and filtering and what have you? To me that's just way more clunky than having an actual programming language. Even PDF, a static document format with no real user interaction, has a programming language (PostScript) embedded.

    So in my view, the problem with JS isn't the features of the language itself, rather that the standard library has too much power, to make requests and access your microphone and stuff like that.

    But even then, people want to use their computer to do video calls, and whatnot. And I for one much prefer using Zoom or Teams or such in the web app, instead of downloading the app version. Precisely because the web app is more tightly sandboxed.

    Replies (2)
    1. But why should all content come with a turing complete language inside? That's a security risk waiting to happen (plus battery drain on your side).

      PDFs are (usually) static pages in a fixed paper format, so they should only display stuff, not do calculations. Same for most web content anyone ever wants to visit (excluding games, demos, actual apps, etc).

      Replies (1)
      1. How exactly is computation a security risk? My entire point is that it's not the computation that's the risk, but what that computation can trigger.

        If you want a real-world example, a food processor is clearly way more dangerous than a TI84. The danger lies in the sharp knives, not in the computing power. That's how I feel when people blame JS's status as a programming language, for things that are rather due to its access to network requests, etc.

        > PDFs are (usually) static pages in a fixed paper format, so they should only display stuff, not do calculations.

        My point is that even for just displaying stuff, it's convenient to have some degree of computation. Look up Kolmogorov complexity. If you've ever used LaTeX, you know how useful it is to have macro expansion in your document format.

        Or consider a CAD program. That's "just" used to design 3D models, circuits, etc., all completely static. Would you agree that it's more useful to support computation such as "place this line 5cm from that" or "repeat this shape 3 times", than to just have your file format be a static list of coordinates?

        Does that illustrate to you why computation is useful? I'm not saying Turing completeness is required, but it's hard to avoid once you support a quite small level of computational expressivity, and there's no real reason to trying to limit it.

        (Unless you want to prove things about your program, but that's another discussion.)

    2. >Are you making a case for built-in components for e.g. sorting and filtering and what have you? To me that's just way more clunky than having an actual programming language.

      I'd take more clunky over what we have any day of the week.

      >A toy example, but HTML+CSS is Turing complete.

      And it shouldn't be. Problem fixed.

      >Even PDF, a static document format with no real user interaction, has a programming language (PostScript) embedded.

      Given the millions of PDF exploits, that's likely the worst example one could give in support of this.

      Replies (1)
      1. No, all PDF exploits I'm aware of are due to JS, not PostScript. I'm happy to be proven wrong, but my point is exactly that the computing power of the language has no relevance on the exploits, rather the quality of the sandboxing and the power of the standard library are what matter.

        For example, if you take away all loops and branches from JS, but still allow it to send network requests, you'll no longer have a Turing complete language (well, you'll have to also remove lambda functions and some other stuff; Turing completeness is complicated). But have you reduced its exploitability? Perhaps marginally, but no more than that.

        You're barking up the wrong tree.

        > And it shouldn't be. Problem fixed.

        Why should it not? What changes would you make to ensure it's not? And what problem would that fix?

        For the record, it's really quite difficult proving a system is not TC. See [1] for a list of examples. Note that I disagree with the "security implications", though it's worthwhile reading. To me, TC is more of a mathematical curiosity of a complex enough system; without other problems such as bad sandboxing or other exploitable features, it has no relevance for security.

        [1] https://gwern.net/turing-complete#surprisingly-turing-comple...

        Replies (1)
        1. >For example, if you take away all loops and branches from JS, but still allow it to send network requests, you'll no longer have a Turing complete language (well, you'll have to also remove lambda functions and some other stuff; Turing completeness is complicated). But have you reduced its exploitability? Perhaps marginally, but no more than that.

          Who said we should still allow it to send network requests? Just to the parent page would be enough.

          And my suggestion was stronger: that we can also drop JS and other functionality from pages handling payment forms altogether.

          Replies (1)
          1. Sure, disabling network requests to other pages is sensible. I interpreted your original comment as suggesting the code execution itself was a problem:

            > run random code on your computer. It is just not acceptable

            > Servers should deliver just data

            > Everying else is nuts.

            You didn't mention network access as a problem once.

            As I've tried to explain here, code execution and network access are entirely orthogonal issues. The latter is a problem (as is downloading data from other servers than the "parent page"), the former is not.

            If you're serving a static PDF or even a static SVG, you're "executing random code" on your clients' computers. Why is that not a problem? Or is it, would you disallow payment pages from embedding SVGs as well?

            Note also that just using a <img> tag, you're sending network requests, potentially to other servers, so disabling JS isn't enough to prevent that. And I'm fairly certain, that if you'd design a "static" prebuilt library of html entities, complex enough to support even a subset of what we've seen JS used for in shop interfaces for example, that'd be powerful enough to do conditional network requests, et cetera.

            Replies (1)
            1. >You didn't mention network access as a problem once.

              Well, isn't it implied from "Servers should deliver just data"?

              Code to be executed is not data. And without that, who would do the random network access, since a mere "payment entry/submit" form wouldn't be able.

              >If you're serving a static PDF or even a static SVG, you're "executing random code" on your clients' computers. Why is that not a problem?

              Allowing code in a format like PDF is already a problem. Same for SVG. Strict markup, with no references and dynamic instructions would be fine.

              >

              Or is it, would you disallow payment pages from embedding SVGs as well?*

              Totally. I'd even go as far as make them a standard, browser provided, form, and that's it. 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.

              Then from the item list, to the "x" buttons to remove an item or "+" to increase the units, to the total amount, be rendered by the browser in a standard format for every shop on the web, similar how a mail app would show every mail as a set of "from", "subject", "body" textboxes.

              Continue this thread (1 replies) →