News for hackers. Stuff that matters.
Re:A proposal to restrict sites from accessing a users' loca... by varenc on Wednesday June 04, 2025 @11:32PM (#44188082)
This tag:

    <img src="http://192.168.1.1/router?reboot=1">
triggers a local network GET request without any CORS involvement.
Re:A proposal to restrict sites from accessing a users' loca... by lyu07282 on Thursday June 05, 2025 @02:26AM (#44188869)
Exactly you can also trigger forms for POST or DELETE etc. this is called CSRF if the endpoint doesn't validate some token in the request. CORS only protects against unauthorized xhr requests. All decades old OWASP basics really.
Re:A proposal to restrict sites from accessing a users' loca... by formerly_proven on Thursday June 05, 2025 @07:10AM (#44190458)
That highly ranked comments on HN (an audience with way above average-engineer interest in software and security) get this wrong kinda explains why these things keep being an issue.
Re:A proposal to restrict sites from accessing a users' loca... by lyu07282 on Thursday June 05, 2025 @11:06AM (#44192409)
I don't know why you are getting downvoted, you do have a point. Some of the comments appear knowing what CORS headers are, but neither their purpose nor how it relates to CSRF it seems, which is worrying. It's not meant as disparaging. My university thought a course on OWASP thankfully, otherwise I'll probably also be oblivious.
Re:A proposal to restrict sites from accessing a users' loca... by asmor on Thursday June 05, 2025 @06:04PM (#44196203)
If you're going cross-domain with XHR, I'd hope you're mostly sending json request bodies and not forms.

Though to be fair, a lot of web frameworks have methods to bind named inputs that allow either.

Re:A proposal to restrict sites from accessing a users' loca... by bawolff on Friday June 06, 2025 @03:20AM (#44198552)
This misses the point a bit. CSRF usually applies to people who want only same domain requests and dont realize that cross domain is an option for the attacker.

In the modern web its much less of an issue due to samesite cookies being default .

Re:A proposal to restrict sites from accessing a users' loca... by mrguyorama on Friday June 06, 2025 @02:41PM (#44203753)
I'm betting HN is vastly more normal people and manager types than people want to admit.

None of us had to pass a security test to post here. There's no filter. That makes it pretty likely that HN's community is exactly as shitty as the rest of the internet's.

People need to stop treating this community like some club of enlightened elites. It's hilariously sad and self-congratulatory.

Re:A proposal to restrict sites from accessing a users' loca... by bawolff on Friday June 06, 2025 @03:18AM (#44198532)
> Exactly you can also trigger forms for POST or DELETE etc

You cant do a DELETE from a form. You have to use ajax. If cross DELETE needs preflight.

To nitpick, CSRF is not the ability to use forms per se, but relying solely on the existence of a cookie to authorize actions with side effects.

Re:A proposal to restrict sites from accessing a users' loca... by grrowl on Thursday June 05, 2025 @03:31AM (#44189270)
I remember back in the day you could embed <img src="http://someothersite.com/forum/ucp.php?mode=logout"> in your forum signature and screw with everyone's sessions across the web
Re:A proposal to restrict sites from accessing a users' loca... by anthk on Thursday June 05, 2025 @03:41AM (#44189324)
<img src="C:\con\con"></img>
Re:A proposal to restrict sites from accessing a users' loca... by jbverschoor on Thursday June 05, 2025 @09:39AM (#44191607)
It's essentially the same, as many apps use HTTP server + html client instead of something native or with another IPC.
Re:A proposal to restrict sites from accessing a users' loca... by lobsterthief on Thursday June 05, 2025 @10:00AM (#44191800)
Haha I remember that. The solution at the time for many forum admins was to simply state that anyone found to be doing that would be permabanned. Which was enough to make it stop completely, at least for the forums that I moderated. Different times indeed.
Re:A proposal to restrict sites from accessing a users' loca... by sedatk on Thursday June 05, 2025 @08:43PM (#44196887)
Or you could just make the logout route POST-only. Problem solved.
Re:A proposal to restrict sites from accessing a users' loca... by buildfocus on Thursday June 05, 2025 @08:59AM (#44191276)
This expectation is that this should not work - well behaved network devices shouldn't accept a blind GET like this for destructive operations. Plenty of other good reasons for that. No real alternative unless you're also going to block page redirects & links to these URLs as well, which also trigger a similar GET. That would make it impossible to access any local network page without typing it manually.

While it clearly isn't a hard guarantee, in practice it does seem to generally work as these have been known issues without apparent massive exploits for decades. That CORS restrictions block probing (no response provided) does help makes this all significantly more difficult.

Re:A proposal to restrict sites from accessing a users' loca... by oasisbob on Thursday June 05, 2025 @12:50PM (#44193378)
"No true Scotsman allows GETs with side effects" is not a strong argument

It's not just HTTP where this is a problem. There are enough http-ish protocols where protocol smuggling confusion is a risk. It's possible to send chimeric HTTP requests at devices which then interpret them as a protocol other than http.

Re:A proposal to restrict sites from accessing a users' loca... by bawolff on Friday June 06, 2025 @03:14AM (#44198504)
Yes, which is why web browsers way back even in the netscape navigator era had a blacklist of ports that are disallowed.