News for hackers. Stuff that matters.
Re:Brute-forcing a macOS user’s real name from a browser usi... by capableweb on Thursday July 13, 2023 @03:07PM (#36714452)
They generally can't, because of CORS. The only reason this "hack" works is because the timing of the rejection is different between non-resolving domain request and resolving-but-rejected request. But if you run something on https://192.168.2.1 it can't be accessed from a web app running on https://my-own-domain.com unless the service running at 192.168.2.1 allows the "Origin" my-own-domain.com.
Re:Brute-forcing a macOS user’s real name from a browser usi... by doakes on Thursday July 13, 2023 @03:29PM (#36714770)
Technically they can make the request. The server will receive and respond to the request. CORS is applied by the browser which prevents the response from being read. This is why CORS doesn't prevent a request from mutating something on a server. A CSRF token does.
Re:Brute-forcing a macOS user’s real name from a browser usi... by aidos on Thursday July 13, 2023 @03:48PM (#36715011)
Is that true? There’s a preflight request that checks with the server as to what’s allowed and then the browser issues the original request if it’s ok, right?
Re:Brute-forcing a macOS user’s real name from a browser usi... by jakear on Thursday July 13, 2023 @04:06PM (#36715223)
"Simple requests" are not preflighted, such as those that do not set any headers (among other qualifications).

https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#simpl...

(Aside, is MDN's href linking broken for everyone or just me?)

Re:Brute-forcing a macOS user’s real name from a browser usi... by bawolff on Thursday July 13, 2023 @07:53PM (#36717679)
It should be noted chrome is changing this behaviour for local networks - https://wicg.github.io/private-network-access/
Re:Brute-forcing a macOS user’s real name from a browser usi... by wging on Thursday July 13, 2023 @11:11PM (#36719052)
Re: your aside, the link works for me. I'm taken directly to the "Simple requests" section.
Re:Brute-forcing a macOS user’s real name from a browser usi... by devsegal on Friday July 14, 2023 @09:37AM (#36723843)
link works for me
Re:Brute-forcing a macOS user’s real name from a browser usi... by zaroth on Thursday July 13, 2023 @04:10PM (#36715258)
"Simple" requests are sent without a OPTIONS preflight check. It's because old style forms could always do a cross-origin request, so you have to protect against it anyway.

For the full definition of what is a "simple" request: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#simpl...

EDIT: Lol @ jakear making an almost identical response with the same Mozilla link.

Re:Brute-forcing a macOS user’s real name from a browser usi... by tomjakubowski on Thursday July 13, 2023 @05:25PM (#36716209)
Not only forms, img and link tags supported cross origin sources too, with no user action required.
Re:Brute-forcing a macOS user’s real name from a browser usi... by lights0123 on Thursday July 13, 2023 @04:30PM (#36715547)
First of all, you could probably do a timing attack on CORS response, you'd just have to deal with how much they're cached.

Depends on the resource request. For example, <img> can be used to load remote resources without CORS, since the image data isn't shared with JS (trying to read it via a canvas marks it "tainted", and errors read requests). Meltdown/Spectre breaks this barrier down, which led to the introduction of COOP/COEP headers that require CORS on remote requests and would break this attack—except that you can ask the browser to send requests without cookies, re-introducing this timing attack.

Re:Brute-forcing a macOS user’s real name from a browser usi... by thakoppno on Thursday July 13, 2023 @04:25PM (#36715469)
There are plenty of browser implementations in things like SmartTVs that don’t implement CORS and other security related features correctly.
Re:Brute-forcing a macOS user’s real name from a browser usi... by ekimekim on Thursday July 13, 2023 @08:29PM (#36717942)
And none of this helps you if the server in question isn't actually a HTTP server, but something else (that only ever expected to be exposed on localhost). Depending on the exact syntax it expects, it's plausible that a HTTP request (even a CORS request) might be misinterpreted to do something nefarious.
Re:Brute-forcing a macOS user’s real name from a browser usi... by _trampeltier on Friday July 14, 2023 @04:27AM (#36720982)
But you could DDoS something on the internal network.
Re:Brute-forcing a macOS user’s real name from a browser usi... by skinner927 on Friday July 14, 2023 @12:48PM (#36726476)
Unless of course the service has no CORS headers and https://192-168-2-1.my-own-domain.com doesn’t resolve to 192.168.2.1.