net-ssh 8.1.1 → 8.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 07eacca644427ed0543e1a428d7075c1d5fd4a0da378e83959dcd312cd7f3500
4
- data.tar.gz: eb50984faecccca334a68cd2b8fc04a749010e85e3cad2acb5e868b44bd168e6
3
+ metadata.gz: 66339496243d9984d49aeebce869255bb936e533280674b6a7aaf9de33381cfa
4
+ data.tar.gz: f2492cf09d1396dac5731fed8bd5b9def374d7900e30e5c03a7fcf00986bad05
5
5
  SHA512:
6
- metadata.gz: 0eab425719d3294df5ece8aff6758c4a627a67b366b661d1a4475b9979c5dea5e614ab583f559fd3a4d36ccd7d8f0cb35776e99a955007830a6ed0b3b37c04bb
7
- data.tar.gz: 4c5a4eaeff4882604a01156bf22322d81c864f26b0637cb0400554206c514aa137a00f9b83ed637001a7ffb4ef599d49d512862963b1dd1041db6886dae44754
6
+ metadata.gz: 54534ecfdc1ef2b0ae192fbdfee3255021100e182c8bec06d48b03d2ea7c669dfa8d626b724d2ccd1f99a3743956196242c13941c39e2363a33c24b2691dce22
7
+ data.tar.gz: c0c8bbc852f0ebc46f223668592a5b78484aa816ade2923f56f59552653fa893f683b2fe408ba9f19fc3391bc8d200bfcf90f12384d3bec812cbd62a776f5c1d
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGES.txt CHANGED
@@ -1,3 +1,7 @@
1
+ === 8.1.2
2
+
3
+ * Security: verify the proxy's certificate and hostname in `Net::SSH::Proxy::HTTPS` by default, and the hostname with any verifying `:ssl_context`; any certificate was accepted, exposing the proxy credentials to a man-in-the-middle. A self-signed or private CA proxy now needs an `:ssl_context` that trusts it, or one with `verify_mode = OpenSSL::SSL::VERIFY_NONE` to skip verification. Thanks @fuzzyrichie [GHSA-qcf4-j55x-72hv]
4
+
1
5
  === 8.1.1
2
6
 
3
7
  * Security: refuse host keys marked `@revoked` in known_hosts, and certificates of such a key or signed by it, by raising the new `Net::SSH::HostKeyRevoked`, which `remember_host!` can't override; these lines were loaded as trusted keys, so every verifier except `:never` accepted the revoked key [GHSA-hjwv-j52r-xcg7]
@@ -1,5 +1,6 @@
1
1
  require 'socket'
2
2
  require 'openssl'
3
+ require 'resolv'
3
4
  require 'net/ssh/proxy/errors'
4
5
  require 'net/ssh/proxy/http'
5
6
 
@@ -15,10 +16,14 @@ module Net
15
16
  # can be used to tweak this proxy connection. In addition to the options
16
17
  # taken by Net::SSH::Proxy::HTTP it supports:
17
18
  #
18
- # * :ssl_context => the SSL configuration to use for the connection
19
+ # * :ssl_context => the SSL configuration to use for the connection. The
20
+ # default verifies the proxy's certificate and hostname against the
21
+ # system trust store. For a self-signed or private CA certificate pass a
22
+ # context with it in +cert_store+, or, to skip verification and expose
23
+ # the proxy credentials to a man-in-the-middle, a context with
24
+ # +verify_mode+ set to OpenSSL::SSL::VERIFY_NONE.
19
25
  def initialize(proxy_host, proxy_port = 80, options = {})
20
- @ssl_context = options.delete(:ssl_context) ||
21
- OpenSSL::SSL::SSLContext.new
26
+ @ssl_context = options.delete(:ssl_context) || default_ssl_context
22
27
  super(proxy_host, proxy_port, options)
23
28
  end
24
29
 
@@ -41,9 +46,28 @@ module Net
41
46
  plain_socket = super(connect_timeout)
42
47
  OpenSSL::SSL::SSLSocket.new(plain_socket, @ssl_context).tap do |socket|
43
48
  socket.extend(SSLSocketCompatibility)
44
- socket.connect
49
+ # SNI must not carry an IP address (RFC 6066).
50
+ socket.hostname = proxy_host unless Resolv::AddressRegex.match?(proxy_host)
51
+ begin
52
+ socket.connect
53
+ socket.post_connection_check(proxy_host) if verify_peer?
54
+ rescue StandardError
55
+ socket.close
56
+ raise
57
+ end
45
58
  end
46
59
  end
60
+
61
+ private
62
+
63
+ def default_ssl_context
64
+ OpenSSL::SSL::SSLContext.new.tap(&:set_params)
65
+ end
66
+
67
+ # verify_mode is nil on a bare SSLContext in older openssl gems.
68
+ def verify_peer?
69
+ @ssl_context.verify_mode.to_i != OpenSSL::SSL::VERIFY_NONE
70
+ end
47
71
  end
48
72
  end
49
73
  end
@@ -52,7 +52,7 @@ module Net
52
52
  MINOR = 1
53
53
 
54
54
  # The tiny component of this version of the Net::SSH library
55
- TINY = 1
55
+ TINY = 2
56
56
 
57
57
  # The prerelease component of this version of the Net::SSH library
58
58
  # nil allowed
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: net-ssh
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.1.1
4
+ version: 8.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamis Buck
@@ -32,7 +32,7 @@ cert_chain:
32
32
  ufHf4AX2UIkJbh7zCPkiNCqIr7MSWLNFG/9lOlHYsEJM8XujT1ofPobYx6YSFx/C
33
33
  7HBrI7UX7awt6UvBZebhcHzyMHxg/B5PVQllPA==
34
34
  -----END CERTIFICATE-----
35
- date: 2026-11-06 00:00:00.000000000 Z
35
+ date: 2026-11-08 00:00:00.000000000 Z
36
36
  dependencies:
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: logger
metadata.gz.sig CHANGED
@@ -1 +1,2 @@
1
- ����K�#��إ�TJ�q�3v|�6e`�gI;f�s�"O)�R��/�?��
1
+ 5SV(��_��]��YoD.h����L��%��cOD�`�:�g��_�4�$xt�D0�M��/��/���}��2��E@9.<��A��b�ɪI�⋕?M��5IO��ފ�L�[�,���:�Z�߮
2
+ ���5@�Sq�1j�E���*8�_�ڑd�xe3h�ɂEg�% ؛d�#�t��}N����$������