8
24
Fork
You've already forked nuMatrix
4

Consider adding blocking rules "from web to localhost" to default to improve security #961

Closed
opened 2018年02月25日 01:06:54 +01:00 by Remu-rin · 3 comments
Remu-rin commented 2018年02月25日 01:06:54 +01:00 (Migrated from github.com)
Copy link

Example case: https://lock.cmpxchg8b.com/utorrent-crash-test.html (background: https://bugs.chromium.org/p/project-zero/issues/detail?id=1524)
Page uses img src attribute to make requests to localhost and this goes through uMatrix default settings (* * image allow). Tested on Firefox and Chrome. Now I added to my rules:

* 127.0.0.1 * block
* localhost * block
* my-LAN-IP * block
127.0.0.1 127.0.0.1 * inherit
localhost localhost * inherit
my-LAN-IP my-LAN-IP * inherit

But maybe 127.0.0.1 and localhost rules are good enough for default? This would make silent attacks like above harder, but won't break services that are running on localhost and intentionally visited by user in the browser (on localhost:port and 127.0.0.1:port). Or there are legitimate cases when remote web page needs to request localhost?

<!-- Read first: https://github.com/gorhill/uMatrix/blob/master/CONTRIBUTING.md No feature requests please. Issue tracker is for PROVEN issues with uMatrix itself. Do not open an issue because your ruleset is interfering negatively with a web site or with the browser's proper functioning. Use the logger to diagnose issues with your ruleset. uMatrix is for advanced users. Do not use the issue tracker to ask for support if you have issues using uMatrix. For question/support/discussions, there is Reddit's /r/uMatrix: https://www.reddit.com/r/uMatrix/ For documentation: https://github.com/gorhill/uMatrix/wiki If you fail to provide basic key information, I will close the issue as invalid with no comment. Use common sense to understand what is basic key information. Examples: browser/version, uMatrix version, relevant browser settings, relevant uMatrix settings, etc. If you report an issue which I can't reproduce immediately, the issue will be closed as unreproducable. Given this, it's important to provide clear and detailed steps-to-reproduce. Please investigate fully and completely before opening an issue, you must make a strong and convincing case that the issue lies with uMatrix. ("works when I turn off uMatrix" is NOT making the case). --> Example case: https://lock.cmpxchg8b.com/utorrent-crash-test.html (background: https://bugs.chromium.org/p/project-zero/issues/detail?id=1524) Page uses img src attribute to make requests to localhost and this goes through uMatrix default settings (`* * image allow`). Tested on Firefox and Chrome. Now I added to my rules: > ` * 127.0.0.1 * block` ` * localhost * block` `* my-LAN-IP * block` `127.0.0.1 127.0.0.1 * inherit` `localhost localhost * inherit` `my-LAN-IP my-LAN-IP * inherit` But maybe 127.0.0.1 and localhost rules are good enough for default? This would make silent attacks like above harder, but won't break services that are running on localhost and intentionally visited by user in the browser (on localhost:port and 127.0.0.1:port). Or there are legitimate cases when remote web page needs to request localhost?
Thorin-Oakenpants commented 2018年02月25日 02:00:14 +01:00 (Migrated from github.com)
Copy link
FYI: see https://github.com/ghacksuserjs/ghacks-user.js/wiki/4.2.3-uMatrix .. namely IPv6 and `192.168`
Remu-rin commented 2018年02月25日 02:53:12 +01:00 (Migrated from github.com)
Copy link

@Thorin-Oakenpants Thanks, these short versions are very handy, didn't knew uM can accept rules like this. Blocking whole ranges is great.
Also strict blocking is not working for those rules when there is * 1st-party * allow, so no need for inherit rules quoted above.

@Thorin-Oakenpants Thanks, these short versions are very handy, didn't knew uM can accept rules like this. Blocking whole ranges is great. Also strict blocking is not working for those rules when there is `* 1st-party * allow`, so no need for inherit rules quoted above.
arek added this to the (deleted) project 2023年11月06日 21:53:28 +01:00
arek modified the project from (deleted) to (deleted) 2023年11月06日 21:53:31 +01:00
arek added this to the v1.0 milestone 2026年06月19日 10:23:34 +02:00
arek added this to the (deleted) project 2026年06月19日 10:25:42 +02:00
arek added this to the v1.0 project 2026年06月19日 10:29:27 +02:00

While this stops literal references to local addresses, it wouldn't stop dns rebind attacks. Adding it by default would break self-hosted services. Won't be adding this since its easy enough to add yourself if you want to.

While this stops literal references to local addresses, it wouldn't stop dns rebind attacks. Adding it by default would break self-hosted services. Won't be adding this since its easy enough to add yourself if you want to.
arek 2026年06月20日 17:12:51 +02:00
  • closed this issue
  • added the
    won't fix
    label
This discussion has been locked. Commenting is limited to contributors.
No Branch/Tag specified
master
dev
v0.1.2
v0.1
0.0.0.8b
0.0.0.7b
0.0.0.5b
0.0.0.4b
0.0.0.3b
0.0.0.2b
0.0.0.1b
1.4.3b0
1.4.2
1.4.1b6
1.4.1b5
1.4.1b4
1.4.0
1.3.17b2
1.3.17b1
1.3.16
1.3.14
1.3.12
1.3.10
1.3.8
1.3.6
1.3.4
1.3.3b9
1.3.3b8
1.3.2
1.3.0
1.2.0
1.1.20
1.1.18
1.1.16
1.1.14
1.1.12
1.1.11b0
1.1.10
1.1.8
1.1.7rc0
1.1.7b0
1.1.6
1.1.4
1.1.0
1.0.0
0.9.3.6
0.9.3.4
0.9.3.3
0.9.3.2
0.9.3.1
0.9.3.0
0.9.2.1
0.9.2.0
0.9.1.2
0.9.1.1
0.9.1.0
0.9.0.1
0.9.0.0
0.8.1.4
0.8.1.3
0.8.1.1
0.8.1.0
0.8.0.1
0.8.0.0
0.8.0.0-rc.2
0.8.0.0-rc.1
0.8.0.0-rc.0
0.8.0.0-alpha.19
0.8.0.0-alpha.18
0.8.0.0-alpha.17
0.8.0.0-alpha.16
0.8.0.0-alpha.15
0.8.0.0-alpha.14
0.8.0.0-alpha.11
0.8.0.0-alpha.10
0.8.0.0-alpha.9
0.8.0.0-alpha.8
0.8.0.0-alpha.7
0.8.0.0-alpha.6
0.8.0.0-alpha.4
0.8.0.0-alpha.3
0.8.0.0-alpha.2
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
arek/nuMatrix#961
Reference in a new issue
arek/nuMatrix
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?