rails-profiler 0.44.24 → 0.44.25
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 +8 -0
- data/lib/profiler/configuration.rb +6 -2
- data/lib/profiler/local_request.rb +6 -0
- data/lib/profiler/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: 9ae9fe0ef9322cba9bf1ae8364bae2cfec9eb1ad3f11010351aa49180fcf2d89
|
|
4
|
+
data.tar.gz: 5cad7f44d5d1b0871a1379ffc1f95f13646a387dbf6146720c519d33a15b1752
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fb37b782a7e5e6fd12d77583dc625037baefb66195d6a59a7242945b0944f48d8d2f10d0cff1057cb4855ef6f4fb83773ac8c3cc00b4d8f6b4c96bb295d0f1e6
|
|
7
|
+
data.tar.gz: 0fde3a7cb33a929fd11caf3c93efb449db493c5e06609f46cf151a5ff7eb6a984823700614850dc9d02aa289cfd208a7ed971e97c80f10a2a8f2adb6388dc14f
|
data/CHANGELOG.md
CHANGED
|
@@ -19,6 +19,14 @@ every commit of every tag interval is accounted for one way or the other.
|
|
|
19
19
|
|
|
20
20
|
## [Unreleased]
|
|
21
21
|
|
|
22
|
+
## [0.44.25] - 2026-10-26
|
|
23
|
+
|
|
24
|
+
<!-- stamped -->
|
|
25
|
+
|
|
26
|
+
### Security
|
|
27
|
+
|
|
28
|
+
- **Authorization:** under `authorization_mode = :allow_authorized`, the `host=` parameter of the `Forwarded` header (RFC 7239) is now checked against the allowed hosts like `Host` and `X-Forwarded-Host`, closing a DNS rebinding bypass through that header.
|
|
29
|
+
|
|
22
30
|
## [0.44.24] - 2026-10-26
|
|
23
31
|
|
|
24
32
|
<!-- stamped -->
|
|
@@ -511,8 +511,8 @@ module Profiler
|
|
|
511
511
|
"host name (#{e.message})"
|
|
512
512
|
end
|
|
513
513
|
|
|
514
|
-
# The DNS rebinding check for :allow_authorized: nil when the Host
|
|
515
|
-
#
|
|
514
|
+
# The DNS rebinding check for :allow_authorized: nil when the Host, X-Forwarded-Host and Forwarded host=
|
|
515
|
+
# values are allowed, otherwise a sentence naming the cause. A host is allowed when it is
|
|
516
516
|
# local, listed in config.hosts, or listed in config.mcp_allowed_hosts: the same rule the MCP
|
|
517
517
|
# HTTP transport already applies (Profiler::MCP::HttpGuard.allowed_host?), so a deployment
|
|
518
518
|
# that already lists its host for MCP does not have to list it twice.
|
|
@@ -532,6 +532,10 @@ module Profiler
|
|
|
532
532
|
return "the X-Forwarded-Host header #{remote.inspect} is not allowed: list it in config.hosts or " \
|
|
533
533
|
"config.mcp_allowed_hosts" if remote
|
|
534
534
|
|
|
535
|
+
forwarded = LocalRequest.forwarded_hosts(request).find { |h| !MCP::HttpGuard.allowed_host?(h, self) }
|
|
536
|
+
return "the Forwarded header host #{forwarded.inspect} is not allowed: list it in config.hosts or " \
|
|
537
|
+
"config.mcp_allowed_hosts" if forwarded
|
|
538
|
+
|
|
535
539
|
nil
|
|
536
540
|
end
|
|
537
541
|
|
|
@@ -104,6 +104,12 @@ module Profiler
|
|
|
104
104
|
allowed_host?(host_name(value))
|
|
105
105
|
end
|
|
106
106
|
|
|
107
|
+
# Hosts named by the host= parameter of a Forwarded header (RFC 7239), for callers that
|
|
108
|
+
# apply their own host policy (Configuration under :allow_authorized).
|
|
109
|
+
def forwarded_hosts(request)
|
|
110
|
+
forwarded_param(request.get_header("HTTP_FORWARDED").to_s, "host")
|
|
111
|
+
end
|
|
112
|
+
|
|
107
113
|
private
|
|
108
114
|
|
|
109
115
|
def host_denial_reason(request)
|
data/lib/profiler/version.rb
CHANGED