mirror of
https://github.com/pezkuwichain/pezkuwi-telemetry.git
synced 2026-10-30 22:49:48 +00:00
Move vulnerable dependencies to patched versions
Backend (Cargo.lock): openssl 0.10.55 -> 0.10.81, bytes 1.12.1, h2 0.3.27, tokio 1.26 -> 1.47.1 (mio 1.x), url 2.3.1 -> 2.5.7 (idna 1.1), rand 0.8.8, spin 0.9.9, time 0.3.55, ring 0.17.14. Three alerts needed manifest changes: - tokio-rustls 0.23 -> 0.26 (rustls 0.20 -> 0.23), which is what moves ring off 0.16. The ring provider is selected explicitly instead of the default aws-lc-rs, so the image build needs no cmake/C toolchain; roots still come from webpki-roots (now 1.0). Checked against live hosts: a valid certificate connects, an expired one and a name mismatch are refused. - maxminddb 0.23 -> 0.27: lookup() now returns a result that is decoded, and the City model's fields are no longer Options. The existing locate_random_ip test (12.5.56.25 -> "Gardena") passes. - structopt (clap 2, which pulled atty) -> clap 4 derive in telemetry_core, telemetry_shard and the soak tests; criterion 0.4 -> 0.5 for the same reason. Both binaries' arguments were parsed before and after for the docker-compose invocations and a set of other cases: identical results, except that `--feed-timeout` given without a value is now an error where structopt silently used the default. --denylist keeps taking every value up to the next flag (num_args = 1..), as its help text describes. Frontend: npm audit fix within ranges, and webpack-dev-server 4 -> 5.2.6 (no devServer options are configured, so nothing to migrate). Left: sockjs -> uuid 8 inside webpack-dev-server 5; the fix is 6.0, which needs Node 22 while CI runs 20, and it is the local dev server only. Checked: backend cargo test (58 passed), clippy, fmt; frontend lint, prettier, test and build.
This commit is contained in:
1 parent
fe3dd7744a
commit
a4fbd9c061
11 files changed
+4830
-2668
No files matched your search
@@ -29,8 +29,9 @@ thiserror = "1.0.24"
|
||||
tokio = { version = "1.8.2", features = ["full"] }
|
||||
tokio-util = { version = "0.7.4", features = ["compat"] }
|
||||
arrayvec = { version = "0.7.1", features = ["serde"] }
|
||||
tokio-rustls = "0.23.4"
|
||||
webpki-roots = "0.22.4"
|
||||
# ring rather than the default aws-lc-rs provider: no cmake/C toolchain in the image build.
|
||||
tokio-rustls = { version = "0.26.6", default-features = false, features = ["logging", "ring", "tls12"] }
|
||||
webpki-roots = "1.0.9"
|
||||
|
||||
[dev-dependencies]
|
||||
bincode = "1.3.3"
|
||||
@@ -20,8 +20,8 @@ use std::io;
|
||||
use std::sync::Arc;
|
||||
use tokio::io::{AsyncRead, AsyncWrite};
|
||||
use tokio::net::TcpStream;
|
||||
use tokio_rustls::rustls::{OwnedTrustAnchor, ServerName};
|
||||
use tokio_rustls::{rustls, TlsConnector};
|
||||
use tokio_rustls::rustls::{self, pki_types::ServerName};
|
||||
use tokio_rustls::TlsConnector;
|
||||
use tokio_util::compat::TokioAsyncReadCompatExt;
|
||||
|
||||
use super::{
|
||||
@@ -274,20 +274,18 @@ async fn may_connect_tls(
|
||||
if !use_https {
|
||||
return Ok(Box::new(socket));
|
||||
};
|
||||
let mut root_cert_store = rustls::RootCertStore::empty();
|
||||
root_cert_store.add_server_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.0.iter().map(|ta| {
|
||||
OwnedTrustAnchor::from_subject_spki_name_constraints(
|
||||
ta.subject,
|
||||
ta.spki,
|
||||
ta.name_constraints,
|
||||
)
|
||||
}));
|
||||
let config = rustls::ClientConfig::builder()
|
||||
.with_safe_defaults()
|
||||
.with_root_certificates(root_cert_store)
|
||||
.with_no_client_auth();
|
||||
let root_cert_store = rustls::RootCertStore {
|
||||
roots: webpki_roots::TLS_SERVER_ROOTS.to_vec(),
|
||||
};
|
||||
let config = rustls::ClientConfig::builder_with_provider(Arc::new(
|
||||
rustls::crypto::ring::default_provider(),
|
||||
))
|
||||
.with_safe_default_protocol_versions()
|
||||
.map_err(|e| io::Error::new(io::ErrorKind::Other, e))?
|
||||
.with_root_certificates(root_cert_store)
|
||||
.with_no_client_auth();
|
||||
let connector = TlsConnector::from(Arc::new(config));
|
||||
let domain = ServerName::try_from(host)
|
||||
let domain = ServerName::try_from(host.to_owned())
|
||||
.map_err(|_| io::Error::new(io::ErrorKind::InvalidInput, "invalid dns name"))?;
|
||||
let socket = connector.connect(domain, socket).await?;
|
||||
Ok(Box::new(socket))
|
||||
|
||||
Reference in new issue
Block a user