8.3high
SurrealKV before 1.1.0 Out-of-Bounds Read via InternalKeyRef Decoder
- Severity
- 8.3high CVSS:4.0 by VulnCheck
- Exploit likelihood
- 0.36% (higher than 31% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- VulnCheck
- Also known as
- RUSTSEC-2026-0452GHSA-9fm9-c4h4-8g93
Description
SurrealKV before 1.1.0 contains an out-of-bounds read vulnerability in the safe InternalKeyRef::from_encoded constructor, which only checks key length with a debug-only assertion. Callers passing keys shorter than 16 bytes, or crafted or corrupted SSTable blocks, trigger unchecked length underflow in timestamp(), seq_num() and trailer(), reading heap bytes before the allocation or panicking.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| surrealdb surrealkv | before 1.1.0 Not affected: 1.1.0 | CVE List |
| surrealkv (crates.io) | from 0.0.0-0 before 1.2.0 | RustSec Advisory Database |
All scores
| VulnCheck | 8.3high CVSS:4.0 | CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:L/SC:H/SI:N/SA:L |
| VulnCheck | 7.9high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:L |
| RustSec Advisory Database | 7.9high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:L |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.
What each source says
CVE List
SurrealKV before 1.1.0 contains an out-of-bounds read vulnerability in the safe InternalKeyRef::from_encoded constructor, which only checks key length with a debug-only assertion. Callers passing keys shorter than 16 bytes, or crafted or corrupted SSTable blocks, trigger unchecked length underflow in timestamp(), seq_num() and trailer(), reading heap bytes before the allocation or panicking.
RustSec Advisory Database
InternalKeyRef::from_encoded is a safe constructor whose only length check is debug_assert!(encoded.len() >= 16), which is compiled out in release builds. Its accessors perform unchecked length arithmetic on the slice: user_key() slices &encoded[..len - 16], trailer()/seq_num() pass len - 16 and timestamp() passes len - 8 to read_u64_be, which computes buffer.as_ptr().add(offset) and performs an 8-byte load. For a short slice the subtraction underflows usize, the pointer wraps below the allocation and eight bytes before the buffer are read (undefined behavior; confirmed with AddressSanitizer as a heap-buffer-overflow). In debug builds the same call panics instead.
The same invariant is missing at the on-disk decode boundary: BlockIterator::seek_next_entry rebuilds the current key from block bytes with upper-bound checks only, and BlockIterator::key() wraps it in InternalKeyRef, which surrealdb's kv-surrealkv backend then reads through key_ref.timestamp(). A crafted or corrupted SSTable therefore reaches the same unchecked subtraction without any unsafe at the call site.
1.2.0 rejects internal keys shorter than their 8-byte trailer before any accessor computes an offset and makes the accessors bounds-checked (fix in commit ac642f9, surrealdb 4.0.0 ships surrealkv 1.2.0).
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-134303 changed 2026-11-23 | CVE Terms of Use |
| RustSec Advisory Database | RUSTSEC-2026-0452 changed 2026-11-21 | CC0-1.0 |
| NVD | CVE-2026-134303 changed 2026-11-23 | Public domain |