Skip to main content
← Vulnerabilities

Out-of-bounds read when decoding internal keys shorter than 16 bytes

Exploited
No known exploitation
Fix
Fixed in 1.2.0
Who is exposed
Not reported

Do first: Upgrade to a fixed version: 1.2.0.

Published
Last modified
10/100 · provisional
None on Exploit-DB, Metasploit or GitHub

Summary

The surrealkv storage engine, used by SurrealDB's kv-surrealkv backend, can read memory before a buffer when it decodes internal keys shorter than 16 bytes, because its length check is removed from release builds. A crafted or corrupted SSTable file can trigger this through the normal on-disk decode path.

Written by anthropic/claude-haiku-5.5 from the sources below. Verify against them.

Read the original description

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).

cve.now Index

10Pcve.now Index 10 of 100 · methodology v3 · provisional
  • Exploitation?/40Unknown. No CISA SSVC exploitation rating yet
  • Exposure?/25Unknown. No advisory context yet
  • Reach10/20Affects crates.io packages
  • Severity?/10Unknown. No CVSS score or vendor rating
  • No patch0/5No signal

What would change the score

  • Would score about 65 if added to CISA KEV
  • Would score about 60 if CISA's SSVC rates exploitation active
  • Would score about 32 if advisories confirm default setups are exposed

What to do

  • Upgrade to a fixed version: 1.2.0.

Timeline

  1. Advisory published3 days
  2. Record last updated

Affected versions

  • surrealkvcrates.io

    From 0.0.0-0 · fixed in 1.2.0

Evidence 4

  1. Advisory
  2. Repository
  3. Repository
  4. Link

Corrections

None so far.

Something wrong on this page? Report an error. Every fix is listed here.

Questions about RUSTSEC-2026-0452

Is RUSTSEC-2026-0452 being exploited?

It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. No public exploit code is tracked.Source: cve.now feed data

Which versions are affected by RUSTSEC-2026-0452?

surrealkv (crates.io): from 0.0.0-0 before 1.2.0.Source: cve.now feed data

How do I fix RUSTSEC-2026-0452?

Upgrade to a fixed version: 1.2.0.Source: cve.now feed data