Skip to main content

SurrealKV CVE-2026-134303

| EUVDEUVD-2026-132244 HIGH
Out-of-bounds Read (CWE-125)
2026-11-21 VulnCheck GHSA-2xmc-95h3-hcrm
8.3
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Gain local control of database files
  2. Exploit
    Supply crafted short-key SSTable block
  3. Execution
    Trigger unchecked length underflow in key accessor
  4. Impact
    Read out-of-bounds heap memory (or panic)

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Bounds checking, read limits
MITRE ATT&CK

1 technique across 1 tactic: Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Two concrete paths. (1) Library path: downstream Rust code calls the crate-root public safe constructor InternalKeyRef::from_encoded(&[u8]) with a slice shorter than 16 bytes and then calls seq_num(), trailer() or timestamp() - the only guard is a debug-only debug_assert!(encoded.len() >= 16), so in a release build (overflow checks off) the len−16/len−8 subtraction wraps and read_u64_be reads before the allocation; no unsafe is needed at the call site. (2) Product path (SurrealDB with the kv-surrealkv/storage-surrealkv backend): a crafted or corrupted SSTable entry whose reconstructed current_key is 1-15 bytes passes BlockIterator::seek_next_entry (which has only upper-bound checks, no len>=16 check) and reaches the same accessors via the wrapper's key_ref.timestamp()/user_key() calls. LIMITING FACTORS: local only, no remote vector is claimed; debug builds panic (subtract-with-overflow / assert) rather than read out of bounds; the normal writer always appends the 16-byte trailer so legitimate data is unaffected; the product path requires filesystem control over or corruption of the database files and (per the reporter) a valid block checksum for the short key, which was not reproduced end-to-end.

Impact

Signals point to a real but non-urgent, locally-scoped memory-safety defect rather than a widespread remote threat. The supplied CVSS 4.0 vector (AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:L/SC:H/SI:N/SA:L, 8.3) is driven by a local attack vector and a confidentiality-dominant impact (heap out-of-bounds read, CWE-125), with a secondary availability impact (panic/DoS, CWE-191). This is consistent with the vendor's own honest scope statement: 'no remote vector is claimed' and the product path 'requires control over / corruption of the database files.' The vuln.today Decision label is 'this_week' (not act_now/emergency), it is NOT listed in CISA KEV, and no EPSS probability was supplied - so there is no signal of active or widespread exploitation. A public PoC reference exists: the GHSA advisory inlines complete minimal PoC source plus AddressSanitizer output, but it demonstrates only the safe public-API trigger (constructing InternalKeyRef from a short slice); the reporter explicitly states no end-to-end crafted-SSTable product reproduction was built (that requires forging a valid block checksum for a short key). Note a data conflict to verify: the CVE description says 'before 1.1.0' while the intelligence feed states vulnerable <1.2.0 / fixed in 1.2.0, and the GHSA says it verified only surrealkv 0.21.2 and asks maintainers to set final affected/patched ranges. Net: a genuine library-grade correctness/UB bug worth patching on a normal cadence, not a high-CVSS-but-illusory issue, but also not an emergency given the local vector and file-control prerequisite.

Exploit ScenarioDerived

An attacker with the ability to supply or corrupt SurrealKV on-disk SSTable files crafts a block whose reconstructed internal key is only 1-15 bytes instead of the required ≥16. When SurrealDB's kv-surrealkv wrapper iterates that block and calls accessors such as timestamp(), seq_num() or trailer(), the unchecked len−16/len−8 subtraction underflows usize in a release build and reads 8 bytes before the heap allocation, leaking adjacent heap memory (or panicking as a DoS). A public PoC in the GHSA advisory demonstrates the same underflow directly against the safe public API; the full product-path exploit was not reproduced.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Nov 21, 2026

Out-of-bounds heap read in SurrealKV's crate-root, safe InternalKeyRef decoder: the constructor InternalKeyRef::from_encoded only enforces its 16-byte minimum with a debug-only assertion, so in release builds a short slice makes the len-16 / len-8 arithmetic wrap and read_u64_be loads 8 bytes from before the allocation. The library API is reachable from ordinary downstream Rust code, and the same missing invariant exists at the on-disk boundary, so a crafted or corrupted SSTable block whose reconstructed key is 1-15 bytes can reach the accessors through SurrealDB's kv-surrealkv wrapper (verified against surrealkv 0.21.2 as pinned by surrealdb 3.3.0-nightly); advisory package metadata lists 1.2.0 as the fixed version while the CVE text refers to releases before 1.1.0. Exposure is local only - no remote vector is claimed, debug builds panic rather than read out of bounds, and the SSTable path requires control over or corruption of the database files, with the end-to-end crafted-block case not reproduced by the reporter. The issue is not in CISA KEV and is not reported as actively exploited; a PoC reference with AddressSanitizer output is inlined in the GHSA advisory demonstrating the library path, and the report itself notes the crafted-SSTable variant was not built end to end.

RemediationAI

Vendor-released patch: surrealkv 1.2.0 per the advisory package metadata (the CVE text refers to pre-1.1.0, so verify the fixed version in the release notes), delivered by commit 914c3ce374bb5d75b10079385a3efb31a9d96e63; for SurrealDB deployments, bump the workspace pin on surrealkv and rebuild with the kv-surrealkv/storage-surrealkv features rather than patching the engine in place. Until that bump is applied, the advisory's own interim measures are actionable: add an explicit key_ref.encoded().len() >= 16 guard in the SurrealDB wrapper (surrealdb/core/src/kvs/surrealkv/mod.rs) before any call to timestamp(), seq_num(), user_key() or trailer(), and reject or return an SSTableError for short current_key values reconstructed in BlockIterator::seek_next_entry - the trade-off is an extra branch per key access and a divergence from upstream that must be maintained until the pinned version changes. Because the product path requires control over or corruption of the database files, restricting filesystem-level write access to the SurrealKV data directories to trusted principals removes that route entirely but does nothing against the library API path, which any in-process Rust code can still trigger; no network-facing workaround is required because no remote vector is claimed. Debug builds panic instead of reading out of bounds, which is diagnostic behavior rather than a mitigation. Advisory: https://github.com/surrealdb/surrealdb/security/advisories/GHSA-9fm9-c4h4-8g93.

Affected VersionsENISA

surrealkv 0 <1.1.0

Affected Packages

cargo surrealkv fix: 1.1.0, 1.2.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in cargo

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

SurrealKV encodes internal keys as user_key || trailer_be(8) || timestamp_be(8), so every accessor assumes a slice of at least 16 bytes. InternalKeyRef<'a> wraps a &'a [u8] and is exported at the crate root; from_encoded performs only debug_assert!(encoded.len() >= 16), which is compiled out in release builds, and the accessors then do unchecked arithmetic: user_key() slices &encoded[..len-16], trailer() and seq_num() compute n = len-16 and pass it to read_u64_be, and timestamp() computes n = len-8. read_u64_be does buffer.as_ptr().add(offset) followed by an 8-byte typed load, so a wrapped usize offset points to base-k and reads before the allocation - the root cause class is CWE-125 out-of-bounds read combined with CWE-191 integer underflow. With len=8, seq_num()/trailer() wrap to base-8; with len=4, timestamp() wraps to base-4 (the ASan-confirmed case, READ of size 8 four bytes before a 4-byte region); user_key() with a short slice panics on slice range rather than reading, and in debug builds overflow checks make the call panic. The same invariant is absent at the decode boundary: BlockIterator::seek_next_entry reconstructs current_key from block bytes with upper-bound checks only and BlockIterator::key() wraps it with the debug assert alone, and SurrealDB's surrealdb/core/src/kvs/surrealkv/mod.rs calls key_ref.timestamp() and user_key() directly, so a short reconstructed key reaches the unchecked subtraction. Two outcomes are possible depending on which accessor runs first: InternalKeyComparator::compare calls user_key_from_encoded and panics (denial of service), while direct timestamp() callers read out of bounds. Normal data is unaffected because the writer always appends the 16-byte trailer; alignment is not a factor since [u8; 8] has alignment 1, and only surrealkv 0.21.2 was verified as a snapshot.

Know when Surrealkv gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (VulnCheck) PRIMARY 8.3 HIGH
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
vuln.today AI 6.1 MEDIUM

Local vector with no remote path; realistic product trigger needs control/corruption of on-disk DB files (PR:L); OOB read discloses heap (C:H), panic gives limited DoS (A:L), no integrity impact.

3.1 AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:L
4.0 AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:L/SC:N/SI:N/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
None
Vulnerable system: Availability
Low
Subsequent system: Confidentiality
High
Subsequent system: Integrity
None
Subsequent system: Availability
Low

DescriptionCVE.org

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.

Technical POC Analysis

CWE-125 (out-of-bounds read), rooted in a missing runtime precondition on a pub safe constructor.

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Executive ViewAI

Why It Matters

A high-severity memory safety flaw in SurrealKV, the storage engine used by SurrealDB, could allow local attackers to read sensitive data from process memory via a specially crafted or corrupted database file. This affects any organization running SurrealDB with the vulnerable SurrealKV version, potentially exposing confidential information stored in the database or process memory.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.4%
Top 70% exploitable
Prevalence
Low
niche embedded storage engine, one of several SurrealDB backends
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
Poc
System Exposure· derived
Small
Automatable
No
Human Impact
High
Technical Impact
Partial

Priority Score

42
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +42
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy