News for hackers. Stuff that matters.
Re:A proposal to restrict sites from accessing a users' loca... by LegionMammal978 on Wednesday June 04, 2025 @05:28PM (#44185740)
The idea is, the malicious actor would use a 'simple request' that doesn't need a preflight (basically, a GET or POST request with form data or plain text), and manage to construct a payload that exploits the target device. But I have yet to see a realistic example of such a payload (the paper I read about the idea only vaguely pointed at the existence of polyglot payloads).
Re:A proposal to restrict sites from accessing a users' loca... by MajesticHobo2 on Wednesday June 04, 2025 @05:47PM (#44185915)
There doesn't need to be any kind of "polyglot payload". Local network services and devices that accept only simple HTTP requests are extremely common. The request will go through and alter state, etc.; you just won't be able to read the response from the browser.
Re:A proposal to restrict sites from accessing a users' loca... by EGreg on Wednesday June 04, 2025 @07:17PM (#44186620)
Exactly. People who are answering must not have been aware of “simple” requests not requiring preflight.
Re:A proposal to restrict sites from accessing a users' loca... by freeone3000 on Wednesday June 04, 2025 @06:23PM (#44186173)
Oh, you can only send arbitrary text or form submissions. That’s SO MUCH.
Re:A proposal to restrict sites from accessing a users' loca... by tomrod on Wednesday June 04, 2025 @11:58PM (#44188193)
Correct.
Re:A proposal to restrict sites from accessing a users' loca... by kbolino on Wednesday June 04, 2025 @05:29PM (#44185752)
Here's a formal definition of such simple requests, which may be more expansive than one might expect: https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/COR...
Re:A proposal to restrict sites from accessing a users' loca... by mirashii on Wednesday June 04, 2025 @06:08PM (#44186067)
You don't even need to be exploiting the target device, you might just be leaking data over that connection.

https://news.ycombinator.com/item?id=44169115

Re:A proposal to restrict sites from accessing a users' loca... by notpushkin on Thursday June 05, 2025 @03:40AM (#44189321)
Yeah, I think this is the reason this proposal is getting more traction again.
Re:A proposal to restrict sites from accessing a users' loca... by drexlspivey on Wednesday June 04, 2025 @06:54PM (#44186442)
It can send a json-rpc request to your bitcoin node and empty your wallet
Re:A proposal to restrict sites from accessing a users' loca... by LegionMammal978 on Thursday June 05, 2025 @03:47PM (#44195156)
Do you know of any such node that doesn't check the Content-Type of requests and also has no authentication?
Re:A proposal to restrict sites from accessing a users' loca... by drexlspivey on Friday June 06, 2025 @07:58AM (#44199943)
Bitcoin Core if you disable authentication
Re:A proposal to restrict sites from accessing a users' loca... by LegionMammal978 on Friday June 06, 2025 @09:02PM (#44206537)
There's no such thing, short of forking it yourself. You can set the username and password to admin:admin if you want, but Bitcoin Core's JSON-RPC server requires an Authorization header on every request [0], and you can't put an Authorization header on a cross-origin request without a preflight.

[0] https://github.com/bitcoin/bitcoin/blob/v29.0/src/httprpc.cp...

Re:A proposal to restrict sites from accessing a users' loca... by drexlspivey on Saturday June 07, 2025 @04:09AM (#44208206)
Good to know, I remember you used to be able to disable it via config but looks like I was wrong
Re:A proposal to restrict sites from accessing a users' loca... by chuckadams on Thursday June 05, 2025 @09:24AM (#44191486)
Some devices don't bother to limit the size of the GET, which can enable a DOS attack at least, a buffer overflow at worst. But I think the most typical vector is a form-data POST, which isn't CSRF-protected because "it's on localhost so it's safe, right?"

I've been that sloppy with dev servers too. Usually not listening on port 80 but that's hardly Ft Knox.

Re:A proposal to restrict sites from accessing a users' loca... by Sophira on Thursday June 05, 2025 @09:56AM (#44191757)
I can give an example of this; I found such a vulnerability a few years ago now in an application I use regularly.

The target application in this case was trying to validate incoming POST requests by checking that the incoming MIME type was "application/json". Normally, you can't make unauthorized XHR requests with this MIME type as CORS will send a preflight.

However, because of the way it was checking for this (checking if the Content-Type header contained the text "application/json"), It was relatively easy to construct a new Content-Type header that bypasses CORS:

Content-Type: multipart/form-data; boundary=application/json

It's worth bearing in mind in this case that the payload doesn't actually have to be form data - the application was expecting JSON, after all! As long as the web server doesn't do its own data validation (which it didn't in this case), we can just pass JSON as normal.

This was particularly bad because the application allowed arbitrary code execution via this endpoint! It was fixed, but in my opinion, something like that should never have been exposed to the network in the first place.

Re:A proposal to restrict sites from accessing a users' loca... by apitman on Friday June 06, 2025 @02:02AM (#44198175)
This is a great example; thanks.
Re:A proposal to restrict sites from accessing a users' loca... by bawolff on Friday June 06, 2025 @03:25AM (#44198575)
I think that is because it is so old that its basically old news and mostly mitigated.

https://www.kb.cert.org/vuls/id/476267 is an article from 2001 on it.