SurrealML CWE-770 unbounded allocation PoC

Proof-of-concept file for a huntr Model Format Vulnerability report against SurrealML (surrealdb/surrealml).

model.surml is a 4-byte file: the big-endian uint32 value 4000000000 (~3.7GB).

Feeding this file to SurMlFile::from_file() (modules/core/src/storage/surml_file.rs, lines 99-129) causes an immediate, unconditional vec![0u8; integer_value as usize] allocation (up to ~4.29GB, the uint32 ceiling) from a 4-byte input, before any validation that the file actually contains that many remaining bytes. The sibling function from_bytes() performs exactly this bounds check before reading - from_file() is missing the same guard.

Reachability: load_model.rs:98 (extern "C" fn load_model) calls SurMlFile::from_file() directly; the Python SDK (surrealml/rust_adapter.py:218-226, load(path)) calls this C function via ctypes - this is the function a Python SDK user calls to load a .surml model file.

Impact: Denial of Service - an attacker who can supply or influence a .surml model file (model registry, file exchange, any pipeline deserializing third-party SurrealML files) can force a bounded-but-large (up to ~4.29GB) allocation with a 4-byte payload, sufficient to OOM/crash most typical container/VM hosts.

Suggested fix: Port the existing bounds check from from_bytes() into from_file() before allocating the header buffer.

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