SurrealML .surml header panic PoC
malicious_origin.surml is a crafted SurrealML model file whose origin header
field is PWNED (no "=>" substring). Loading it through
SurMlFile::from_file() reaches Origin::from_string()
(modules/core/src/storage/header/origin.rs), which does:
let mut split = origin.split("=>");
let author = split.next().unwrap().to_string();
let origin = split.next().unwrap().to_string(); // panics: split only yielded 1 item
Loading this file panics the host process (called Option::unwrap() on a None value,
Rust panic exit code 101). The FFI entry point used by the Python client and
SurrealDB's embedding (modules/c-wrapper/src/api/storage/load_model.rs) has no
catch_unwind, so the panic isn't caught โ it aborts (or is UB, per Rust's FFI-unwind
rules) whatever process loaded the file.
modelscan does not recognize .surml as a supported format and skips the file
entirely ("No issues found" โ see modelscan_output.txt), so a malicious file like
this passes existing scanning tooling undetected.
Reported to huntr.com as a Model File Vulnerability (MFV) submission โ "Denial of Service through malformed model files" category.