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 | 388 comments on HN | Vote on HN (opens Hacker News) |

View full thread · View on Hacker News

Comment thread (24)

  1. One basic design no-go of the www is to allow strangers to run random code on your computer. It is just not acceptable. Servers should deliver just data and my browser decides what to do with it. A shop should deliver lists of items and prizes and my shop browser decides how to operate with the catalogue in a way I want. Everying else is nuts.
    Replies (3)
    1. How would you handle items with customization such as custom engravings? This would be both simple customizations as well as things requiring a full graphic or 3d editor? Previews of your items? How avoid discounts based on item combinations that are store-specific? Is your browser smart enough to do complex searches and filters for things like photo gear where some values have ranges? What will your browser do for builders such as putting together kits of equipment or supplies that may or may not all go together?

      Like yes designing a generalized shopping experience is possible. It is also going to limit the long tail of features OR become such a huge and bloated spec that it will make things way worse. Imagine Temu but for all the shops.

      Besides, doesn’t your browser and OS come from some third party? How much do you trust them to be bug and backdoor free? Or do you have your own browser and OS that you know for sure can do all this and you have verified?

      Replies (3)
      1. An optimistic path I see is LLMs making browsers smart enough to whip up personalized, ad hoc UIs for everything you suggest while every server becomes a glorified data provider as per the GP comment.

        You'd still have to trust the hardware, OS, browser, and now an LLM too, but that threat model could be preferable to running arbitrary (especially 3rd party) Javascript.

      2. With an exception for thing-editors that are not built into the browser (but could be, e.g. text is built in), all of those are rather easily covered by "the server sends that information". E.g. add something to your cart -> that loads the next page which has updated discount availability.

        They weren't saying websites should be completely static, just maybe they shouldn't run attacker-controlled code.

        Replies (1)
        1. How would you handle something that needs real-time sync? Constantly poll the server for updates and resend the entire page?
          Replies (1)
          1. I'm not sure I understand all the contrived examples.

            Yes, you could do that. Works fine. How often should it need to be?

            Or it could resend a diff of the page. We have remotely rendered AAA game platforms, where you just get some video back at 60fps, we can surely send commerce changes too even at 1/1000 the bandwidth.

            Or you could have something like Ajax/XHR/messaging, or pub/sub push of plain data, no need to "the browser can be send any arbitrary code to execute".

            Replies (1)
            1. Yeah, server-sent partial page updates seem like a fairly trivial thing for a browser to implement. That they don't currently says nothing about the feasibility, especially when we're already talking about a hypothetical world where browsers don't execute JavaScript.

              Browsers supporting 3D model editing in N formats that constantly change and add features? Quite a bit less likely.

      3. >How would you handle items with customization such as custom engravings?

        Is this supposed to be a generally applicable example, or that we should base the design of web commerce moving trillions of dollars to the needs of such niche areas?

        Let's do "limit the long tail of features" for 80% of things that don't need it, so that my grandma can buy sweaters without needed a degree in cybersecurity.

        We can have a special laxer renderer for that that comes up with red blinking alerts when you visit those pages.

        Nothing about an example like custom engraving requires the current everything-available web model anyway. As an example we have remotely rendered 3d gaming GeForce NOW, xCloud, etc. We surely can support something like placing an engraving text on a product.

        >How to avoid discounts based on item combinations that are store-specific? Is your browser smart enough to do complex searches and filters for things like photo gear where some values have ranges?

        You know we can have server side logic since the 90s, right?

    2. > 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.

              Continue this thread (1 replies) →

    3. This wouldn't change the fact that the site owner gets to decide which code runs on their site, whether in your browser or on their backend. In a counterfactual world in which Javascript never became a thing, I'm sure there'd now be all kinds of horribly sketchy server-side plugins causing very similar types of problems.

      In both worlds, the problem is who a site owner decides to grant access to your shopping session, not the fact that access can be granted at all. Or how would you ban them from e.g. insecurely transmitting your card data to their payment service processor on their backend? You just wouldn't see it.

      Replies (1)
      1. Maybe it's time to reboot. Just like "Google AMP" tried to reinvent pages that aren't slow as molasses, we could invent "secure websites" that run without JS, or only with whitelisted standard frameworks and make it a thing. Browsers would only enable payment stuff on those secure websites and display a super green icon.
        Replies (2)
        1. "Google AMP" tried to reinvent pages with a substantial commercial advantage for Google - not pages that aren't slow as molasses.
          Replies (1)
          1. Sure, but the pages had to be fast too, and fulfill certain requirements.
        2. Sure, but how do you avoid the problem of sites just doing the nasty insecure plugin stuff on their server side then?

          If you can think of a practical way to display a cool icon if and only if a given business has good security practices, go ahead and build it – it would be worth at least billions.