llamafile
poc-llamafile-ip-trust-bypass
PoC: Llamafile Inverted IP Trust Logic (Authentication Bypass)
Vulnerability
Component: Mozilla-Ocho/llamafile — HTTP server IP trust
CWE: CWE-697 (Incorrect Comparison) → CWE-287 (Improper Authentication)
Severity: CRITICAL (CVSS 9.1)
Bug
In llamafile/server/client.cpp:217, the condition checking parse_ip()'s return value is inverted:
if ((ip = parse_ip(ip_header)) == -1) { // BUG: == should be !=
effective_ip_ = ip; // Runs on… See the full description on the dataset page: https://huggingface.co/datasets/0xiviel/poc-llamafile-ip-trust-bypass.llamafile-zip-overflow-poc
Llamafile ZIP parser integer wraparound → OOB read
Vulnerability
CWE-190/CWE-125: Integer Wraparound → Out-of-bounds Read in Llamafile's ZIP parser (llamafile/llamafile.c).
get_zip_cfile_compressed_size() returns int64_t -1 when the central directory
entry has COMPRESSEDSIZE=0xFFFFFFFF (ZIP64 sentinel) but no valid ZIP64 extra
field. This -1 is assigned to size_t file->size (= SIZE_MAX on 64-bit), causing
mapsize = skew + SIZE_MAX to wrap to a tiny value:
//… See the full description on the dataset page: https://huggingface.co/datasets/Talson/llamafile-zip-overflow-poc.llamafile-zip-poc
