Skip to content

Commit 3fe7be1

Browse files
authored
Fix RUSTSEC-2026-0097 (#2331)
## Which issue does this PR close? - Closes #2327 #2328 #2329 ## What changes are included in this PR? Upgrade rnd version, use recommended api. ## Are these changes tested? ut.
1 parent d6692fc commit 3fe7be1

6 files changed

Lines changed: 41 additions & 37 deletions

File tree

.cargo/audit.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,9 @@ ignore = [
3333
#
3434
# Introduced by object_store, see https://github.com/apache/arrow-rs-object-store/issues/564
3535
"RUSTSEC-2025-0134",
36+
# `rand` unsoundness with custom logger using `rand::rng()`
37+
#
38+
# Direct dependency upgraded to 0.9.3+. Transitive rand 0.8.5 remains
39+
# from reqsign/sqllogictest/rustc-hash — no 0.8.x patch exists.
40+
"RUSTSEC-2026-0097",
3641
]

Cargo.lock

Lines changed: 28 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ ordered-float = "4"
108108
parquet = "58"
109109
pilota = "0.11.10"
110110
pretty_assertions = "1.4"
111-
rand = "0.8.5"
111+
rand = "0.9.3"
112112
regex = "1.11.3"
113113
reqwest = { version = "0.12.12", default-features = false, features = ["json"] }
114114
roaring = { version = "0.11" }

crates/iceberg/src/expr/visitors/page_index_evaluator.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ mod tests {
793793
};
794794
use parquet::file::metadata::{PageIndexPolicy, ParquetMetaData};
795795
use parquet::file::properties::WriterProperties;
796-
use rand::{Rng, thread_rng};
796+
use rand::Rng;
797797
use tempfile::NamedTempFile;
798798

799799
use super::PageIndexEvaluator;
@@ -1284,13 +1284,13 @@ mod tests {
12841284

12851285
#[test]
12861286
fn eval_in_length_of_set_above_limit_all_rows() -> Result<()> {
1287-
let mut rng = thread_rng();
1287+
let mut rng = rand::rng();
12881288
let (metadata, _temp_file) = create_test_parquet_file()?;
12891289
let (column_index, offset_index, row_group_metadata) = get_test_metadata(&metadata);
12901290
let (iceberg_schema_ref, field_id_map) = build_iceberg_schema_and_field_map()?;
12911291

12921292
let filter = Reference::new("col_float")
1293-
.is_in(std::iter::repeat_with(|| Datum::float(rng.gen_range(0.0..10.0))).take(1000))
1293+
.is_in(std::iter::repeat_with(|| Datum::float(rng.random_range(0.0..10.0))).take(1000))
12941294
.bind(iceberg_schema_ref.clone(), false)?;
12951295

12961296
let result = PageIndexEvaluator::eval(

crates/iceberg/src/expr/visitors/row_group_metrics_evaluator.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ mod tests {
528528
use parquet::schema::types::{
529529
ColumnDescriptor, ColumnPath, SchemaDescriptor, Type as parquetSchemaType,
530530
};
531-
use rand::{Rng, thread_rng};
531+
use rand::Rng;
532532

533533
use super::RowGroupMetricsEvaluator;
534534
use crate::Result;
@@ -1617,7 +1617,7 @@ mod tests {
16171617

16181618
#[test]
16191619
fn eval_true_for_too_many_literals_filter_is_in() -> Result<()> {
1620-
let mut rng = thread_rng();
1620+
let mut rng = rand::rng();
16211621

16221622
let row_group_metadata = create_row_group_metadata(
16231623
1,
@@ -1636,7 +1636,7 @@ mod tests {
16361636
let (iceberg_schema_ref, field_id_map) = build_iceberg_schema_and_field_map()?;
16371637

16381638
let filter = Reference::new("col_float")
1639-
.is_in(std::iter::repeat_with(|| Datum::float(rng.gen_range(0.0..10.0))).take(1000))
1639+
.is_in(std::iter::repeat_with(|| Datum::float(rng.random_range(0.0..10.0))).take(1000))
16401640
.bind(iceberg_schema_ref.clone(), false)?;
16411641

16421642
let result = RowGroupMetricsEvaluator::eval(

crates/iceberg/src/writer/file_writer/rolling_writer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ mod tests {
399399
"Kelly", "Larry", "Mallory", "Shawn",
400400
];
401401

402-
let mut rng = rand::thread_rng();
402+
let mut rng = rand::rng();
403403
let batch_num = 10;
404404
let batch_rows = 100;
405405
let expected_rows = batch_num * batch_rows;

0 commit comments

Comments
 (0)