chore: bump up Rust crate rand to v0.9.3 [SECURITY] (#14832)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [rand](https://rust-random.github.io/book)
([source](https://redirect.github.com/rust-random/rand)) | dependencies
| patch | `0.9.1` → `0.9.3` |
| [rand](https://rust-random.github.io/book)
([source](https://redirect.github.com/rust-random/rand)) |
workspace.dependencies | patch | `0.9.2` → `0.9.3` |

### GitHub Vulnerability Alerts

####
[GHSA-cq8v-f236-94qc](https://redirect.github.com/rust-random/rand/pull/1763)

It has been reported (by @​lopopolo) that the `rand` library is
[unsound](https://rust-lang.github.io/unsafe-code-guidelines/glossary.html#soundness-of-code--of-a-library)
(i.e. that safe code using the public API can cause Undefined Behaviour)
when all the following conditions are met:

- The `log` and `thread_rng` features are enabled
- A [custom
logger](https://docs.rs/log/latest/log/#implementing-a-logger) is
defined
- The custom logger accesses `rand::rng()` (previously
`rand::thread_rng()`) and calls any `TryRng` (previously `RngCore`)
methods on `ThreadRng`
- The `ThreadRng` (attempts to) reseed while called from the custom
logger (this happens every 64 kB of generated data)
- Trace-level logging is enabled or warn-level logging is enabled and
the random source (the `getrandom` crate) is unable to provide a new
seed

`TryRng` (previously `RngCore`) methods for `ThreadRng` use `unsafe`
code to cast `*mut BlockRng<ReseedingCore>` to `&mut
BlockRng<ReseedingCore>`. When all the above conditions are met this
results in an aliased mutable reference, violating the Stacked Borrows
rules. Miri is able to detect this violation in sample code. Since
construction of [aliased mutable references is Undefined
Behaviour](https://doc.rust-lang.org/stable/nomicon/references.html),
the behaviour of optimized builds is hard to predict.

Affected versions of `rand` are `>= 0.7, < 0.9.3` and `0.10.0`.

##### Severity
Low

---

### Release Notes

<details>
<summary>rust-random/rand (rand)</summary>

###
[`v0.9.3`](https://redirect.github.com/rust-random/rand/compare/0.9.2...0.9.3)

[Compare
Source](https://redirect.github.com/rust-random/rand/compare/0.9.2...0.9.3)

###
[`v0.9.2`](https://redirect.github.com/rust-random/rand/blob/HEAD/CHANGELOG.md#092---2025-07-20)

[Compare
Source](https://redirect.github.com/rust-random/rand/compare/0.9.1...0.9.2)

##### Deprecated

- Deprecate `rand::rngs::mock` module and `StepRng` generator
([#&#8203;1634](https://redirect.github.com/rust-random/rand/issues/1634))

##### Additions

- Enable `WeightedIndex<usize>` (de)serialization
([#&#8203;1646](https://redirect.github.com/rust-random/rand/issues/1646))

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - ""
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/toeverything/AFFiNE).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMjAuMiIsInVwZGF0ZWRJblZlciI6IjQzLjEyMC4yIiwidGFyZ2V0QnJhbmNoIjoiY2FuYXJ5IiwibGFiZWxzIjpbImRlcGVuZGVuY2llcyJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This commit is contained in:
renovate[bot]
2026-04-16 19:52:25 +08:00
committed by GitHub
parent 1d66e7e8ca
commit dc3b95c886
2 changed files with 16 additions and 16 deletions

20
Cargo.lock generated
View File

@@ -48,7 +48,7 @@ dependencies = [
"path-ext",
"pdf-extract",
"pulldown-cmark",
"rand 0.9.2",
"rand 0.9.3",
"rayon",
"readability",
"serde",
@@ -94,7 +94,7 @@ dependencies = [
"objc2-foundation",
"ogg",
"opus-codec",
"rand 0.9.2",
"rand 0.9.3",
"rubato",
"screencapturekit",
"symphonia",
@@ -204,7 +204,7 @@ dependencies = [
"napi",
"napi-build",
"napi-derive",
"rand 0.9.2",
"rand 0.9.3",
"rayon",
"serde",
"serde_json",
@@ -3431,7 +3431,7 @@ dependencies = [
"md-5",
"nom 8.0.0",
"nom_locate",
"rand 0.9.2",
"rand 0.9.3",
"rangemap",
"sha2",
"stringprep",
@@ -4572,7 +4572,7 @@ dependencies = [
"bit-vec 0.8.0",
"bitflags 2.11.0",
"num-traits",
"rand 0.9.2",
"rand 0.9.3",
"rand_chacha 0.9.0",
"rand_xorshift",
"regex-syntax",
@@ -4698,9 +4698,9 @@ dependencies = [
[[package]]
name = "rand"
version = "0.9.2"
version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
checksum = "7ec095654a25171c2124e9e3393a930bddbffdc939556c914957a4c3e0a87166"
dependencies = [
"rand_chacha 0.9.0",
"rand_core 0.9.5",
@@ -4751,7 +4751,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a8615d50dcf34fa31f7ab52692afec947c4dd0ab803cc87cb3b0b4570ff7463"
dependencies = [
"num-traits",
"rand 0.9.2",
"rand 0.9.3",
]
[[package]]
@@ -8146,7 +8146,7 @@ dependencies = [
"path-ext",
"proptest",
"proptest-derive",
"rand 0.9.2",
"rand 0.9.3",
"rand_chacha 0.9.0",
"rand_distr",
"serde",
@@ -8168,7 +8168,7 @@ dependencies = [
"phf 0.11.3",
"proptest",
"proptest-derive",
"rand 0.9.2",
"rand 0.9.3",
"rand_chacha 0.9.0",
"regex",
"y-octo",

View File

@@ -622,9 +622,9 @@ dependencies = [
[[package]]
name = "rand"
version = "0.9.1"
version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97"
checksum = "7ec095654a25171c2124e9e3393a930bddbffdc939556c914957a4c3e0a87166"
dependencies = [
"rand_chacha 0.9.0",
"rand_core 0.9.3",
@@ -675,7 +675,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a8615d50dcf34fa31f7ab52692afec947c4dd0ab803cc87cb3b0b4570ff7463"
dependencies = [
"num-traits",
"rand 0.9.1",
"rand 0.9.3",
]
[[package]]
@@ -1177,7 +1177,7 @@ dependencies = [
"nanoid",
"nom",
"ordered-float",
"rand 0.9.1",
"rand 0.9.3",
"rand_chacha 0.9.0",
"rand_distr",
"serde",
@@ -1192,7 +1192,7 @@ version = "0.0.0"
dependencies = [
"lib0",
"libfuzzer-sys",
"rand 0.9.1",
"rand 0.9.3",
"rand_chacha 0.9.0",
"y-octo",
"y-octo-utils",
@@ -1207,7 +1207,7 @@ dependencies = [
"clap",
"lib0",
"phf",
"rand 0.9.1",
"rand 0.9.3",
"rand_chacha 0.9.0",
"y-octo",
"yrs",