SurrealML .surml Denial of Service PoC

Vulnerability: Unbounded heap allocation in SurMlFile::from_file()
Severity: Medium (DoS via malformed model file)
Affected: SurrealML all versions as of June 2026

Files

File Size header_len claimed Effect
dos_4gb.surml 8 bytes 0xFFFFFFFF (~4 GiB) OOM crash
dos_256mb.surml 8 bytes 256 MiB 256 MiB alloc

Root Cause

modules/core/src/storage/surml_file.rs in from_file():

let integer_value = u32::from_be_bytes(buffer);  // attacker-controlled
// NO size guard:
let mut header_buffer = vec![0u8; integer_value as usize];  // up to 4 GiB

An 8-byte .surml file forces a 4 GiB heap allocation.

Reproduce

pip install surrealml
python3 reproduce.py

Fix

const MAX_HEADER_SIZE: usize = 64 * 1024 * 1024;
if integer_value as usize > MAX_HEADER_SIZE {
    return Err(SurrealError::new("header too large".into(), ...));
}
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support