net-ssh 7.3.7 → 7.3.8
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
- checksums.yaml.gz.sig +0 -0
- data/CHANGES.txt +4 -0
- data/lib/net/ssh/proxy/jump.rb +27 -6
- data/lib/net/ssh/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a32034e7f363bc87196ff8a13b8c79bd7e9b246e98375c8e8d505cd52ea0b19a
|
|
4
|
+
data.tar.gz: d98d516fa2ddc9a8e2718e60ea4367da99ae49b5082ec0b4897db24cc86a625f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d5d09d26af82a639bb793453e27f95b89cb1dbcc15a2bd22ccad8bc7e7106d848008927dbee29b5a8f7c280a15a5bd9eced464c45f004f0c1b64ee2bb1bb8eee
|
|
7
|
+
data.tar.gz: 5b97d998e035e0c3a499ae89168f10b7e484cbf87ef551d16a11ddef1cf9d1f729b26a204d9cdabb7e1ea7b99de0e4322d9e71cba384c3d47ac0db85ccc2b8ac
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/CHANGES.txt
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
=== 7.3.8
|
|
2
|
+
|
|
3
|
+
* Security: validate every ProxyJump hop, not only the first, as [user@]host[:port] (refusing a path, query, fragment or password) and shell-escape the hops passed to ssh -J; a hop such as `evil/x&$(cmd)` ran `cmd` through the shell [GHSA-g2r2-x3p2-5677]
|
|
4
|
+
|
|
1
5
|
=== 7.3.7
|
|
2
6
|
|
|
3
7
|
* Fixed `unexpected packet type 94 during initial key exchange` (or 93) when channel data arrives during a client-initiated re-key, which broke bulk transfers at the first re-key (e.g. with `rekey_limit`, or after about 1 GB); a regression in 7.3.5 [#1063]
|
data/lib/net/ssh/proxy/jump.rb
CHANGED
|
@@ -35,28 +35,49 @@ module Net
|
|
|
35
35
|
# We cannot build the ProxyCommand template until we know if the :config
|
|
36
36
|
# option was specified during `Net::SSH.start`.
|
|
37
37
|
def build_proxy_command_equivalent(connection_options = nil)
|
|
38
|
-
|
|
38
|
+
raise ArgumentError, "no jump host given" if jump_proxies.empty?
|
|
39
|
+
|
|
39
40
|
config = connection_options && connection_options[:config]
|
|
40
|
-
uri, = jump_proxies.split(",").map { |jump| validate_jump!(jump) }
|
|
41
|
+
uri, *extra_jumps = jump_proxies.split(",", -1).map { |jump| validate_jump!(jump) }
|
|
41
42
|
|
|
42
43
|
template = "ssh".dup
|
|
43
|
-
template << " -l #{uri.user}"
|
|
44
|
-
template << " -p #{uri.port}"
|
|
45
|
-
template << " -J #{extra_jumps}"
|
|
44
|
+
template << " -l #{escape(uri.user)}" if uri.user
|
|
45
|
+
template << " -p #{uri.port}" if uri.port
|
|
46
|
+
template << " -J #{escape(extra_jumps.map { |jump| jump_spec(jump) }.join(','))}" unless extra_jumps.empty?
|
|
46
47
|
template << " -F #{Shellwords.escape(config)}" if config != true && config
|
|
47
48
|
template << " -W %h:%p "
|
|
48
|
-
template << uri.host
|
|
49
|
+
template << escape(uri.host)
|
|
49
50
|
|
|
50
51
|
@command_line_template = template
|
|
51
52
|
end
|
|
52
53
|
|
|
53
54
|
private
|
|
54
55
|
|
|
56
|
+
# Escape for the shell, and double any % so it survives the %h/%p
|
|
57
|
+
# substitution done on the template in Command#open.
|
|
58
|
+
def escape(value)
|
|
59
|
+
Shellwords.escape(value).gsub("%", "%%")
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Only [user@]host[:port] is checked, so anything else URI accepts (a path,
|
|
63
|
+
# query, fragment or password) must be refused before it reaches the shell.
|
|
55
64
|
def validate_jump!(jump)
|
|
56
65
|
uri = URI.parse("ssh://#{jump}")
|
|
66
|
+
raise URI::InvalidURIError if uri.host.to_s.empty? || jump_spec(uri) != jump
|
|
67
|
+
|
|
57
68
|
validate_user_name!(uri.user) if uri.user
|
|
58
69
|
validate_host_name!(uri.host)
|
|
70
|
+
validate_port!(uri.port) if uri.port
|
|
59
71
|
uri
|
|
72
|
+
rescue URI::InvalidURIError
|
|
73
|
+
raise ArgumentError, "jump host is not [user@]host[:port]: #{jump.inspect}"
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def jump_spec(uri)
|
|
77
|
+
spec = uri.host.dup
|
|
78
|
+
spec.prepend("#{uri.user}@") if uri.user
|
|
79
|
+
spec << ":#{uri.port}" if uri.port
|
|
80
|
+
spec
|
|
60
81
|
end
|
|
61
82
|
end
|
|
62
83
|
end
|
data/lib/net/ssh/version.rb
CHANGED
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
`WL�,�r_t�|ͧ�'���dJ|W�dYO�7Y;R�d�<9/b(�z؝0mF��7Z7d��}���V���m���-��(�u��$p�]���Uf��Nq�ʂ�yW�>���(i������?7���2<�̂��9j井�s�V�:>%�k=��xt���$�
|