{"id":"CVE-2026-134303","aliases":["CVE-2026-134303","RUSTSEC-2026-0452","GHSA-9fm9-c4h4-8g93"],"related":[],"kind":"vulnerability","state":"published","title":"SurrealKV before 1.1.0 Out-of-Bounds Read via InternalKeyRef Decoder","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"`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.\n\nThe 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.\n\n`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).","format":"markdown","source":"rustsec"}],"published":"2026-11-03T12:00:00.000Z","modified":"2026-11-23T17:17:34.730Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"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","score":8.3,"rating":"HIGH"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"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","score":8.3,"rating":"HIGH"},{"scorer":"VulnCheck","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:L","score":7.9,"rating":"HIGH"},{"scorer":"RustSec Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:L","score":7.9,"rating":"HIGH"}],"cwes":["CWE-125"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"1.1.0","status":"affected"},{"type":"semver","version":"1.1.0","status":"unaffected"}],"vendor":"surrealdb","product":"surrealkv","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"1.2.0"}],"ecosystem":"crates.io","package":"surrealkv","purl":"pkg:cargo/surrealkv","source":"rustsec"}],"references":[{"url":"https://github.com/surrealdb/surrealdb/security/advisories/GHSA-9fm9-c4h4-8g93","tags":["exploit","vendor-advisory"],"sources":["cvelist","nvd"]},{"url":"https://github.com/surrealdb/surrealdb/commit/914c3ce374bb5d75b10079385a3efb31a9d96e63","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://www.vulncheck.com/advisories/surrealkv-before-1.1.0-out-of-bounds-read-via-internalkeyref-decoder","tags":["third-party-advisory"],"sources":["cvelist","nvd"]},{"url":"https://crates.io/crates/surrealkv","tags":["package"],"sources":["rustsec"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0452.html","tags":["advisory"],"sources":["rustsec"]},{"url":"https://github.com/surrealdb/surrealkv/commit/ac642f945d63c9c9f7ad35f480995fd516f83fb6","tags":["web"],"sources":["rustsec"]},{"url":"https://github.com/surrealdb/surrealkv/pull/497","tags":["web"],"sources":["rustsec"]}],"credits":["YZL0v3ZZ"],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-11-23T16:35:06.339Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-134303","url":"https://www.cve.org/CVERecord?id=CVE-2026-134303","licence":"CVE Terms of Use","modified":"2026-11-23T16:35:29.787Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2026-0452","url":"https://rustsec.org/advisories/RUSTSEC-2026-0452.html","licence":"CC0-1.0","modified":"2026-11-21T18:10:37.740Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-134303","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-134303","licence":"Public domain","modified":"2026-11-23T17:17:34.730Z"}],"updatedAt":"2026-11-25T22:59:52.538Z","epss":{"score":0.0036,"percentile":0.31776,"date":"2026-12-01T12:00:22.000Z"}}