Mitigate CSRF attacks against internal networks (block rfc 1918 local addresses from non-local addresses)
Categories
(Core :: Networking, enhancement, P3)
Tracking
()
People
(Reporter: usenet, Unassigned)
References
(Depends on 1 open bug, Blocks 2 open bugs, )
Details
(Keywords: sec-moderate, sec-want, Whiteboard: [sg:moderate][sg:want vector][tor 10839][necko-triaged])
Attachments
(7 files, 32 obsolete files)
2.54 KB,
text/plain
|
Details | |
251.88 KB,
application/zip
|
Details | |
25.06 KB,
patch
|
Details | Diff | Splinter Review | |
55.66 KB,
patch
|
mcmanus
:
review+
|
Details | Diff | Splinter Review |
25.86 KB,
patch
|
sworkman
:
review+
|
Details | Diff | Splinter Review |
26.04 KB,
patch
|
sworkman
:
review+
|
Details | Diff | Splinter Review |
108.55 KB,
patch
|
Sylvestre
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
Updated•18 years ago
|
Reporter | ||
Comment 1•18 years ago
|
||
Reporter | ||
Comment 2•18 years ago
|
||
Reporter | ||
Comment 3•18 years ago
|
||
Reporter | ||
Comment 4•18 years ago
|
||
Reporter | ||
Comment 5•18 years ago
|
||
Reporter | ||
Comment 6•18 years ago
|
||
Updated•18 years ago
|
Updated•18 years ago
|
Updated•18 years ago
|
Updated•18 years ago
|
Updated•17 years ago
|
Updated•17 years ago
|
Comment 7•17 years ago
|
||
Comment 9•17 years ago
|
||
Reporter | ||
Comment 10•17 years ago
|
||
Updated•17 years ago
|
Updated•17 years ago
|
Updated•17 years ago
|
Comment 11•17 years ago
|
||
Comment 12•17 years ago
|
||
Comment 13•17 years ago
|
||
Comment 14•17 years ago
|
||
Comment 15•17 years ago
|
||
Reporter | ||
Comment 16•17 years ago
|
||
Comment 17•17 years ago
|
||
Comment 18•17 years ago
|
||
Reporter | ||
Comment 19•17 years ago
|
||
Comment 20•17 years ago
|
||
Reporter | ||
Comment 21•17 years ago
|
||
Comment 22•17 years ago
|
||
Comment 23•17 years ago
|
||
Comment 24•17 years ago
|
||
Comment 25•17 years ago
|
||
Comment 26•17 years ago
|
||
Updated•17 years ago
|
Comment 27•17 years ago
|
||
Comment 28•17 years ago
|
||
Comment 29•17 years ago
|
||
Comment 30•17 years ago
|
||
Comment 31•17 years ago
|
||
Comment 32•17 years ago
|
||
Comment 33•17 years ago
|
||
Comment 34•17 years ago
|
||
Comment 35•17 years ago
|
||
Comment 36•17 years ago
|
||
Comment 37•17 years ago
|
||
Reporter | ||
Comment 38•17 years ago
|
||
Reporter | ||
Comment 39•17 years ago
|
||
Comment 40•17 years ago
|
||
Reporter | ||
Comment 41•17 years ago
|
||
Comment 42•17 years ago
|
||
Reporter | ||
Comment 43•17 years ago
|
||
Reporter | ||
Comment 44•17 years ago
|
||
Reporter | ||
Comment 45•17 years ago
|
||
Reporter | ||
Comment 46•17 years ago
|
||
Comment 47•17 years ago
|
||
Comment 48•17 years ago
|
||
Comment 49•17 years ago
|
||
Reporter | ||
Comment 50•17 years ago
|
||
Comment 51•17 years ago
|
||
Updated•17 years ago
|
Comment 52•17 years ago
|
||
Comment 53•17 years ago
|
||
Comment 54•17 years ago
|
||
Comment 55•17 years ago
|
||
Comment 56•17 years ago
|
||
Comment 57•17 years ago
|
||
Comment 58•17 years ago
|
||
Updated•17 years ago
|
Comment 59•17 years ago
|
||
Comment 60•17 years ago
|
||
Reporter | ||
Comment 61•17 years ago
|
||
Reporter | ||
Comment 62•17 years ago
|
||
Reporter | ||
Comment 63•17 years ago
|
||
Comment 64•17 years ago
|
||
Comment 66•17 years ago
|
||
Comment 67•17 years ago
|
||
Comment 68•17 years ago
|
||
Updated•17 years ago
|
Updated•17 years ago
|
Updated•17 years ago
|
Comment 69•17 years ago
|
||
Comment 70•17 years ago
|
||
Comment 71•17 years ago
|
||
Updated•17 years ago
|
Reporter | ||
Comment 72•17 years ago
|
||
Comment 73•17 years ago
|
||
Comment 74•17 years ago
|
||
Comment 75•17 years ago
|
||
Comment 77•16 years ago
|
||
Comment 78•16 years ago
|
||
Comment 79•16 years ago
|
||
![]() |
||
Comment 80•16 years ago
|
||
Comment 81•16 years ago
|
||
Comment 82•16 years ago
|
||
Reporter | ||
Comment 83•16 years ago
|
||
Comment 84•16 years ago
|
||
![]() |
||
Comment 85•16 years ago
|
||
Comment 86•16 years ago
|
||
Comment 87•15 years ago
|
||
Comment 88•15 years ago
|
||
Comment 89•15 years ago
|
||
Comment 90•15 years ago
|
||
Comment 91•15 years ago
|
||
Comment 92•15 years ago
|
||
Comment 93•15 years ago
|
||
Comment 94•15 years ago
|
||
Comment 95•15 years ago
|
||
Reporter | ||
Comment 96•15 years ago
|
||
Reporter | ||
Comment 97•15 years ago
|
||
Comment 98•15 years ago
|
||
Comment 99•15 years ago
|
||
Comment 100•15 years ago
|
||
Comment 101•15 years ago
|
||
Comment 102•15 years ago
|
||
Comment 103•15 years ago
|
||
Comment 104•15 years ago
|
||
Comment 105•15 years ago
|
||
Comment 106•15 years ago
|
||
Comment 107•14 years ago
|
||
Comment 108•14 years ago
|
||
Reporter | ||
Comment 109•14 years ago
|
||
Reporter | ||
Comment 110•14 years ago
|
||
Reporter | ||
Comment 111•14 years ago
|
||
Comment 112•14 years ago
|
||
Comment 113•14 years ago
|
||
Comment 114•14 years ago
|
||
Comment 115•14 years ago
|
||
Reporter | ||
Comment 116•14 years ago
|
||
Comment 117•14 years ago
|
||
Reporter | ||
Comment 118•14 years ago
|
||
Comment 119•14 years ago
|
||
Comment 120•14 years ago
|
||
Comment 121•13 years ago
|
||
Comment 122•13 years ago
|
||
Comment 123•13 years ago
|
||
Comment 124•13 years ago
|
||
Comment 125•13 years ago
|
||
Comment 126•13 years ago
|
||
Comment 127•13 years ago
|
||
Reporter | ||
Comment 128•13 years ago
|
||
Comment 129•13 years ago
|
||
Comment 130•13 years ago
|
||
Comment 131•13 years ago
|
||
Comment 132•13 years ago
|
||
Reporter | ||
Comment 133•13 years ago
|
||
Comment 134•13 years ago
|
||
Reporter | ||
Comment 135•13 years ago
|
||
![]() |
||
Updated•13 years ago
|
Comment 137•13 years ago
|
||
Comment 138•13 years ago
|
||
Comment 139•11 years ago
|
||
Reporter | ||
Comment 140•11 years ago
|
||
Comment 142•11 years ago
|
||
![]() |
||
Comment 143•11 years ago
|
||
Comment 144•11 years ago
|
||
![]() |
||
Comment 145•11 years ago
|
||
Comment 146•11 years ago
|
||
Comment 147•11 years ago
|
||
![]() |
||
Comment 149•11 years ago
|
||
Comment 150•11 years ago
|
||
![]() |
||
Comment 151•11 years ago
|
||
![]() |
||
Comment 152•11 years ago
|
||
![]() |
||
Comment 153•11 years ago
|
||
Comment 154•11 years ago
|
||
Comment 155•11 years ago
|
||
Comment 156•11 years ago
|
||
Updated•11 years ago
|
![]() |
||
Comment 157•11 years ago
|
||
![]() |
||
Comment 158•11 years ago
|
||
Comment 159•11 years ago
|
||
![]() |
||
Comment 160•11 years ago
|
||
![]() |
||
Comment 161•11 years ago
|
||
Comment 162•11 years ago
|
||
Comment 163•11 years ago
|
||
Comment 164•11 years ago
|
||
Comment 165•11 years ago
|
||
Updated•11 years ago
|
Updated•11 years ago
|
Updated•11 years ago
|
Comment 166•11 years ago
|
||
Comment 167•11 years ago
|
||
Comment 168•11 years ago
|
||
Comment 169•11 years ago
|
||
Comment 170•11 years ago
|
||
![]() |
||
Comment 171•11 years ago
|
||
Comment 172•11 years ago
|
||
Comment 173•11 years ago
|
||
Comment 174•11 years ago
|
||
Updated•11 years ago
|
Updated•11 years ago
|
Updated•11 years ago
|
Updated•11 years ago
|
Updated•11 years ago
|
Comment 176•11 years ago
|
||
Comment 178•11 years ago
|
||
Comment 179•11 years ago
|
||
Comment 181•11 years ago
|
||
Comment 182•11 years ago
|
||
Comment 183•11 years ago
|
||
Updated•11 years ago
|
Comment 184•11 years ago
|
||
Comment 185•11 years ago
|
||
Updated•11 years ago
|
Updated•11 years ago
|
Comment 187•11 years ago
|
||
Comment 188•11 years ago
|
||
Updated•11 years ago
|
Comment 189•11 years ago
|
||
Updated•11 years ago
|
![]() |
||
Updated•11 years ago
|
Updated•10 years ago
|
Comment 190•10 years ago
|
||
Updated•9 years ago
|
Comment 191•8 years ago
|
||
Comment 192•8 years ago
|
||
Comment 193•7 years ago
|
||
Comment 194•7 years ago
|
||
![]() |
||
Comment 195•7 years ago
|
||
Comment 196•7 years ago
|
||
![]() |
||
Comment 197•7 years ago
|
||
Updated•7 years ago
|
Comment 198•7 years ago
|
||
Comment 200•6 years ago
|
||
I should also note that something this (although in this case localhost, not RFC 1918) would have at the very least made the recent Zoom videoconferencing apparent to end-users, and perhaps raised the alarm about it earlier.
Comment 201•6 years ago
|
||
(In reply to Neil Harris from comment #200)
I should also note that something this (although in this case localhost, not RFC 1918) would have at the very least made the recent Zoom videoconferencing apparent to end-users, and perhaps raised the alarm about it earlier.
That should read "Zoom videoconferencing security problem"
Updated•5 years ago
|
Comment 207•4 years ago
|
||
I would like to just add here that every web app dev that I tell about this is very surprised that browsers allow this. syncthing wasn't password protected for a long while and uses a localhost web interface that is exposed on localhost (hence reachable via this exploit), same for a gdb debugger I'm working with right now, and allowing ANY website from anywhere in the web to just silently find and access these things running on my PC just seems like a needlessly reckless default.
I think doing an opt-in header check as Chromium does it to at least abort the connection early would be the absolute minimum to make this somewhat secure, but it could still cause security issues for services that don't expect HTTP to come in and somehow crash/misbehave when any random website through my browser can just throw things at them via HTTP at localhost when it wasn't designed to be world reachable like that.
So I would suggest that a per site permission is reconsidered, with the default being off and a permission pop up any time a new site wants to access a computer-local or network local address. This should be preferably on top of the opt-in header that Chromium is already proposing.
Comment 208•4 years ago
|
||
Nevermind, seems like same origin would at least limit it to "only" intranet attacks I assume...? So not as bad as I thought. Still, seems like a permission would be the best way to go to me, since a partial HTTP request aborted by no same origin headers is still not the nicest thing to allow for anyone to poke around with in the local network. (Which I assume would remain possible in some fashion unless this is a per site permission where the user needs to allow any such access first.) My apologizes if that is an incorrect assumption still on my side
Updated•3 years ago
|
Updated•2 years ago
|
Comment 211•1 year ago
|
||
I think this is what Chrome is doing: requiring CORS on internet->intranet connections:
https://bugs.chromium.org/p/chromium/issues/detail?id=590714
"We'll begin requiring servers on a user's machine (127.0.0.1) or intranet (as defined by RFC1918) to explicitly opt-in to connections originating from the public internet."
Some useful discussion there
Updated•1 year ago
|
Updated•1 year ago
|
Comment 212•1 year ago
|
||
See also: https://bugzilla.mozilla.org/show_bug.cgi?id=1872502
I think to address these problems: what CORS be should be better defined.
https://bugzilla.mozilla.org/show_bug.cgi?id=1872569#c6
Comment 215•7 months ago
|
||
I think CORS might be insufficient, because:
-
It could still be used by a malicious website to send a HTTP request to check those headers to any local port, which could disrupt or manipulate non-HTTP services in some cases.
-
Many of the services that use localhost access in a way CORS would likely still allow, e.g. Discord for invite links, or mega.nz for identifying a local mega daemon, will also break private mode and make the user identifiable despite a private window.
Both of this would likely be stopped if, how I proposed in #1890701 , there was a site setting, similar to web cam access, microphone access, etc. This would prevent drive-by HTTP disruptions and private mode disruptions unless the user explicitly opts in. CORS could still be checked in addition.
Updated•7 months ago
|
Comment 217•7 months ago
|
||
Two things this would break:
-
Anything reachable on both public and private addresses that accesses itself on the private address even from the public side. Thinking about network device admin pages here. Even though it's an inherently broken behavior I wouldn't be very surprised to encounter it.
-
Publicly hosted apps used as a client to access devices on the LAN. This is a pattern I'm seeing increasingly often both in IT administration (central console managing multiple hosts) and with various "smart" gadgets (device exposing only an API to be used with either a mobile app or a hosted webapp).
CORS already prevents sending requests to services that do not want them. I'd argue anything these days that misbehaves upon receiving HTTP headers (or any kind of traffic that's not its intended protocol), or that sends CORS headers while being vulnerable to malicious/unauthenticated HTTP requests, is inherently insecure and is itself what needs to be fixed, not the browser. This isn't 2005 anymore. If you're using a firewall as your sole access control method, you already lost.
Comment 218•7 months ago
|
||
There is plenty of software that listens on localhost that doesn't expect to be prepared against arbitrary internet attackers, so I think the browser does need to be fixed if it breaks that.
For what it's worth, both breakages listed above shouldn't be a problem if it was a per-site permission. It would just require the user to allow it.
Comment hidden (advocacy) |
Comment 220•7 months ago
|
||
Since many people seem to be dropping by, this seems to be trying to mitigate the issue: https://addons.mozilla.org/en-US/firefox/addon/port-authority/ Although I don't know how reliably if somebody really tried to get around it, and sadly it doesn't seem to have a per-site permission but only a global toggle but that still seems better than nothing. Disclaimer: I'm neither affiliated with that addon nor do I have the time resources to fully review if it's safe to use.
Comment 221•7 months ago
|
||
Now that this issue has suddenly become so widely and publicly recognized as a severe vulnerability, might it be appropriate to:
change "Type" from "Enhancement" to "Defect", and
change "Priority" from "P3" to "P1" or "P2", and
change "Severity" from "S3" to "S1" or "S2"?
Comment 222•7 months ago
|
||
(In reply to Ellie from comment #220)
Since many people seem to be dropping by, this seems to be trying to mitigate the issue: https://addons.mozilla.org/en-US/firefox/addon/port-authority/
This is probably OT, but since it was raised, the Port Authority extension doesn't appear to mitigate this issue. I'm indebted to this comment which points to the relevant code in the extension.
Comment 223•7 months ago
|
||
Good catch! It mitigates any other access to LAN or localhost from external sites however, which seems to match the bug title and seems like at least a partial mitigation. Many users don't seem to think this type of access should be possible without an opt-in.
Comment 224•7 months ago
|
||
(Correction: at least that's my best guess from the extension code. I'm not a qualified to make a definite statement, I'm not a firefox dev.)
Comment 225•7 months ago
|
||
FWIW, NoScript does provide configurable protection against this.
Comment 226•7 months ago
|
||
uMatrix can protect against this, with following extra rule lines:
* 0.0.0.0 * block
* 127.0.0.1 * block
* localhost * block
127.0.0.1 127.0.0.1 * inherit
localhost localhost * inherit
Note that after typing, the ordering changes alphabetically, which does not affect the effect.
Comment 227•6 months ago
|
||
Here is a recent analysis of this entire issue:
https://www.oligo.security/blog/0-0-0-0-day-exploiting-localhost-apis-from-the-browser
It contains several references to Firefox.
Comment 228•5 months ago
|
||
Hi,
Three comments:
-
A workaround is available using uBlock Origin extension, with the filter list "Block Outsider Intrusion into LAN" (Settings / Filter Lists / Privacy, select "Block Outsider Intrusion into LAN").
-
Severity, and as a consequence priority, seems underestimated. It is a security vulnerability, actively exploited, allowing malicious scripts on malformed webpage to reach localhost servers or LAN devices. It is a way to circumvent firewalls:
- browser accesses a webpage with allowed outgoing connection on HTTP or HTTPS ports,
- then a malicious script is executed on this page, and reaches servers listening on localhost (directly with 127.0.0.1 calls; or indirectly with 0.0.0.0 calls on Linux and macOS, not on Windows),
- or reaches devices on LAN (with addresses such as 192.168.1.x, as an example).
- As per https://www.oligo.security/blog/0-0-0-0-day-exploiting-localhost-apis-from-the-browser, Firefox has two different problems:
- no Private Network Access policy, that would allow access to localhost and LAN addresses from private network only, and block it from public/internet network,
- no blocking of "0.0.0.0" IP address, that is identical to "127.0.0.1" on Linux and macOS but not on Windows (blocked at the system level).
Regards,
MN
Comment 229•5 months ago
|
||
(In reply to Michel Nallino from comment #228)
- As per https://www.oligo.security/blog/0-0-0-0-day-exploiting-localhost-apis-from-the-browser, Firefox has two different problems:
- no Private Network Access policy, that would allow access to localhost and LAN addresses from private network only, and block it from public/internet network,
We'll be starting work on this soon in bug 1481298.
- no blocking of "0.0.0.0" IP address, that is identical to "127.0.0.1" on Linux and macOS but not on Windows (blocked at the system level).
This was already fixed in bug 1889130. It's behind a pref and will be rolling out to release soon.
Comment 230•5 months ago
|
||
I'm really sorry for repeating myself, but is there still any chance that a per site permission will be considered? Just limiting the LAN access to services that want to be reachable from internet browsers as far as I can tell still 1. seems to break private mode by letting services like discord identify you and your specific account by contacting your local desktop client instance even if you're in private mode, and still 2. seems to allow fingerprinting users by scanning all the LAN services that are enabled for internet browser access. A per-site permission like camera access for LAN-and-localhost access would easily allow the user to avoid this.
Description
•