{"vuln_id":"CVE-2026-134303","aliases":["GHSA-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.","published_at":"2026-11-03T12:00:00Z","modified_at":"2026-11-21T18:10:37.740884Z","first_seen_at":"2026-11-21T19:15:51.700184Z","severity":"high","severity_source":"nvd","cvss_score":8.3,"cvss_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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","cwe":["CWE-125"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":0.00358,"epss_percentile":0.30208,"nvd_status":"Received","enriched_at":null,"links":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-134303"},"matched_alias":null,"items":[{"id":10310,"source":{"id":"nvd","name":"NVD CVE API 2.0"},"title":"CVE-2026-134303: 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 d…","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.\n\nReferences:\nhttps://github.com/surrealdb/surrealdb/commit/914c3ce374bb5d75b10079385a3efb31a9d96e63\nhttps://github.com/surrealdb/surrealdb/security/advisories/GHSA-9fm9-c4h4-8g93\nhttps://www.vulncheck.com/advisories/surrealkv-before-1.1.0-out-of-bounds-read-via-internalkeyref-decoder","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-134303","published_at":"2026-11-21T17:16:50.480000Z","updated_at":"2026-11-21T17:16:50.480000Z","fetched_at":"2026-11-21T19:15:31.485800Z","severity":"high","cvss_score":8.3,"epss":0.00358,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":null,"vuln_id":"CVE-2026-134303","vuln_ids":["CVE-2026-134303","GHSA-9FM9-C4H4-8G93"],"tags":["CWE-125"],"cluster_id":10426,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/10310","html":"https://vulnwatch.ve1ve2.com/item/10310"}},{"id":11006,"source":{"id":"osv","name":"OSV.dev"},"title":"RUSTSEC-2026-0452: Out-of-bounds read when decoding internal keys shorter than 16 bytes","summary":"Out-of-bounds read when decoding internal keys shorter than 16 bytes\n\n`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).\n\nAffected: crates.io:surrealkv\n\nFixed in: 1.2.0\n\nReferences:\nhttps://crates.io/crates/surrealkv\nhttps://rustsec.org/advisories/RUSTSEC-2026-0452.html\nhttps://github.com/surrealdb/surrealkv/commit/ac642f945d63c9c9f7ad35f480995fd516f83fb6\nhttps://github.com/surrealdb/surrealkv/pull/497","url":"https://osv.dev/vulnerability/RUSTSEC-2026-0452","published_at":"2026-11-03T12:00:00Z","updated_at":"2026-11-21T18:10:37.740884Z","fetched_at":"2026-11-21T19:15:55.946364Z","severity":"high","cvss_score":8.3,"epss":0.00358,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"surrealkv","vuln_id":"CVE-2026-134303","vuln_ids":["CVE-2026-134303","GHSA-9FM9-C4H4-8G93","RUSTSEC-2026-0452"],"tags":["osv","crates.io","fix-available"],"cluster_id":10426,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/11006","html":"https://vulnwatch.ve1ve2.com/item/11006"}}]}