Downloads · 30 days
0
Damir2024/samsung-one-circle-verifier-bypass-poc
samsung-one-circle-verifier-bypass-poc is a machine learning model from Damir2024. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
Target: circle (specifically the Samsung/ONE runtime)
Downloads · 30 days
0
Access
Public
Updated May 19, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.md4.1 KB · 65%
From the Hugging Face model README
Target: circle (specifically the Samsung/ONE runtime)
Vulnerability: Verification Bypass in BaseLoader<LoaderDomain>::loadModel()
A critical vulnerability exists in the Samsung/ONE runtime's model loading logic. In the file runtime/onert/core/src/loader/BaseLoader.h, the loadModel() function invokes LoaderDomain::VerifyModelBuffer() to validate the integrity and structure of the incoming FlatBuffer model. However, the return value of this verification function is entirely ignored.
Following the ignored verification step, the loader proceeds to call LoaderDomain::GetModel(_base) and subsequently dereferences FlatBuffer accessors on the unverified buffer. This lack of enforcement allows a maliciously crafted .circle file with invalid offsets or structures to bypass verification, leading to out-of-bounds reads and potential memory corruption (crash) when the loader attempts to access model metadata or subgraphs.
The PoC involves creating a minimal 8-byte .circle file that contains the required CIR0 identifier but specifies a root offset that points back into the identifier bytes themselves. This structure is invalid and should be caught by the verifier, but because the verifier's result is ignored, the loader attempts to process it as a valid model.
00000000: 0400 0000 4349 5230 ....CIR0
0400 0000: Root offset (4), pointing to the identifier.4349 5230: File identifier (CIR0).Clone the Samsung/ONE Repository:
git clone --depth 50 https://github.com/Samsung/ONE
cd ONE
Generate the Malicious .circle File:
import struct
payload = struct.pack("<I", 4) + b"CIR0"
with open("bad-root-offset.circle", "wb") as f:
f.write(payload)
Build the Runtime with ASan (AddressSanitizer):
Follow the standard build instructions for Samsung/ONE, ensuring -DASAN_BUILD=ON is enabled to capture the crash.
Load the Malicious Model:
Use a minimal sample or test tool provided by the ONE runtime to load bad-root-offset.circle.
./nnfw_run --model bad-root-offset.circle
The runtime will crash with an out-of-bounds read or similar memory violation. The crash path typically involves:
BaseLoader<Circle LoaderDomain>::loadModel
circle::Model::metadata()
flatbuffers::Table::GetOptionalFieldOffset
The impact of this vulnerability is High:
The fix is straightforward: the loader must check the return value of VerifyModelBuffer() and abort the loading process if verification fails.
// runtime/onert/core/src/loader/BaseLoader.h
template <typename LoaderDomain> std::unique_ptr<ir::Model> BaseLoader<LoaderDomain>::loadModel()
{
if (!LoaderDomain::VerifyModelBuffer(*_verifier.get()))
{
throw std::runtime_error("Model verification failed");
}
_domain_model = LoaderDomain::GetModel(_base);
// ... rest of the function
}
runtime/onert/core/src/loader/BaseLoader.h⚡️👾 by🇭🇷PhonkAlphabet 👾⚡️