CVE-2026-134303 in SurrealKVinfo

Summary

by MITRE • 11/21/2026

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.

If you want to get best quality of vulnerability data, you may have to visit VulDB.

Analysis

by VulDB Data Team • 11/21/2026

The vulnerability identified in SurrealKV versions prior to 1.1.0 represents a critical memory safety flaw rooted in insufficient input validation within the core data structure handling logic. Specifically, the issue resides in the safe constructor InternalKeyRef::from_encoded, which is responsible for parsing and validating encoded key structures used internally by the database engine. The fundamental technical defect lies in the fact that length checks are performed exclusively via debug-only assertions rather than runtime bounds checking mechanisms available in release builds. This architectural decision means that while developers may catch errors during testing phases using verbose logging or assertion failures, production deployments operating with optimized code paths lack these protective guards entirely. Consequently, any entity capable of supplying input to this constructor can exploit the absence of validation logic without triggering immediate program termination through standard error handling pathways.

The operational impact manifests when callers pass keys shorter than sixteen bytes or provide crafted and corrupted SSTable blocks that do not conform to expected structural integrity requirements. Because the length verification is absent in non-debug builds, the subsequent methods timestamp(), seq_num(), and trailer() proceed to calculate offsets based on invalid assumptions about data boundaries. These calculations result in an unchecked integer underflow when determining memory addresses relative to the start of the allocated buffer. Instead of returning an error or panicking safely as intended by safe Rust semantics, the code attempts to read heap bytes located before the beginning of the allocation. This constitutes a classic out-of-bounds read vulnerability where sensitive information from adjacent memory regions may be exposed to the application logic, potentially leading to data leakage if the retrieved values are utilized in subsequent operations or returned to external callers.

From a classification perspective, this flaw aligns with CWE-125 Out-of-bounds Read and CWE-787 Out-of-bounds Write depending on how the read memory is subsequently used within the application state machine. The vulnerability also reflects weaknesses associated with CWE-697 Incorrect Comparison Due to Integer Underflow or Overflow, as the root cause stems from arithmetic operations performed on unchecked length values that fail to account for minimum size constraints required by the internal key format specification. In terms of adversarial tactics, this scenario maps to ATT&CK technique T1059 Command and Scripting Interpreter if exploited via automated scripts feeding malformed SSTables, or more directly to data exfiltration techniques where memory contents are read out-of-band through application responses that inadvertently include leaked heap metadata.

Mitigation strategies must prioritize immediate patching to version 1.1.0 or later where the constructor has been hardened with proper runtime bounds checking. For environments unable to upgrade immediately, defensive programming practices should be enforced at all entry points feeding data into SurrealKV internals. This includes implementing explicit length validation checks before invoking any internal parsing functions and ensuring that external inputs are sanitized against minimum size requirements defined by the key format specification. Additionally, enabling AddressSanitizer during testing phases can help identify similar latent issues in other parts of the codebase where debug assertions might similarly be stripped out in production builds. Regular security audits focusing on memory safety patterns in Rust applications are recommended to prevent recurrence of such assertion-dependent vulnerabilities that compromise reliability and confidentiality guarantees.

Responsible

VulnCheck

Reservation

11/21/2026

Disclosure

11/21/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Do you want to use VulDB in your project?

Use the official API to access entries easily!