hanami-webconsole 3.0.0.rc1 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -1
- data/lib/hanami/webconsole/middleware.rb +16 -0
- data/lib/hanami/webconsole/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: da5c6cfe03eb08f1a9150feed8b9a19ded65ef96f34e316f40bc8cdb1566433e
|
|
4
|
+
data.tar.gz: 0da8fb0995ea0a1ec08942463e4ca3db07eec08ba00a4835062d0a00653134cc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ff5ff81939bbd22592fb190b8ae32b948e0749264e8a99fc523935d54778ba85a3518d9875fcd080a68dd2ccbe2991db0297ad3dfe98112438327f936cc3936e
|
|
7
|
+
data.tar.gz: e5d1a07594a44acb90b5ff9d2ec06b332896cc93703866552d67d70bc32156783b17e4363e5ee033b516df8ca69b5c85fa25ea8daea589b48582b6ee5300388a
|
data/CHANGELOG.md
CHANGED
|
@@ -19,7 +19,24 @@ and this project adheres to [Break Versioning](https://www.taoensso.com/break-ve
|
|
|
19
19
|
|
|
20
20
|
### Security
|
|
21
21
|
|
|
22
|
-
[Unreleased]: https://github.com/hanami/hanami-webconsole/compare/v3.0.
|
|
22
|
+
[Unreleased]: https://github.com/hanami/hanami-webconsole/compare/v3.0.1...HEAD
|
|
23
|
+
|
|
24
|
+
## [3.0.1] - 2026-11-24
|
|
25
|
+
|
|
26
|
+
### Security
|
|
27
|
+
|
|
28
|
+
- Decide whether a request may reach the console from `REMOTE_ADDR` alone, overriding BetterErrors' check. Previously, `X-Forwarded-For`, `Client-IP` and `Forwarded` headers were trusted from peers on private networks, so anyone on the same network could claim a loopback address and run code in the app. Requests without a `REMOTE_ADDR` are now denied. (@parndt in GHSA-qxv3-3w54-whwp)
|
|
29
|
+
|
|
30
|
+
[3.0.1]: https://github.com/hanami/hanami-webconsole/compare/v3.0.0...v3.0.1
|
|
31
|
+
|
|
32
|
+
## [3.0.0] - 2026-06-30
|
|
33
|
+
|
|
34
|
+
### Changed
|
|
35
|
+
|
|
36
|
+
- Update to binding_of_caller 2.0, which formally supports Ruby 4.0. Remove our internal workarounds for this. (@rvmtz in #14)
|
|
37
|
+
- Require Ruby 3.3 or newer.
|
|
38
|
+
|
|
39
|
+
[3.0.0]: https://github.com/hanami/hanami-webconsole/compare/v2.3.3...v3.0.0
|
|
23
40
|
|
|
24
41
|
## [3.0.0.rc1] - 2026-06-16
|
|
25
42
|
|
|
@@ -35,6 +35,22 @@ module Hanami
|
|
|
35
35
|
|
|
36
36
|
super
|
|
37
37
|
end
|
|
38
|
+
|
|
39
|
+
private
|
|
40
|
+
|
|
41
|
+
# Reads `REMOTE_ADDR` rather than `Rack::Request#ip`, which trusts `X-Forwarded-For` and
|
|
42
|
+
# `Forwarded` from private-network peers, so any host on the same network could claim to be
|
|
43
|
+
# 127.0.0.1. A missing or blank address is denied, unlike in BetterErrors. An IPv6 zone id
|
|
44
|
+
# is stripped before parsing, and an unparseable address is denied rather than raised.
|
|
45
|
+
def allow_ip?(env)
|
|
46
|
+
ip = env["REMOTE_ADDR"]
|
|
47
|
+
return false if ip.nil? || ip.strip.empty?
|
|
48
|
+
|
|
49
|
+
address = IPAddr.new(ip.split("%").first)
|
|
50
|
+
BetterErrors::Middleware::ALLOWED_IPS.any? { |subnet| subnet.include?(address) }
|
|
51
|
+
rescue IPAddr::InvalidAddressError
|
|
52
|
+
false
|
|
53
|
+
end
|
|
38
54
|
end
|
|
39
55
|
BetterErrors::Middleware.prepend(BetterErrorsExtension)
|
|
40
56
|
|