Field NotesDecember 2025
Track the pattern, not the CVE: pickle over ZeroMQ in six AI inference projects
Oligo's ShadowMQ research of November 2025 attributes a family of flaws in AI inference frameworks to copied code; the code we read shows copying at two links, and only one of them carries the flaw. From the advisories, the CVE records and each project's code as it stood, we build a lineage table, three spellings, three exploitability conditions, four fix types and a white-box variant-analysis procedure.
In this piece
On 13 November 2025 Oligo Security published its ShadowMQ research. It reported that Meta's Llama Stack, NVIDIA's TensorRT-LLM, vLLM, SGLang, Modular's Max Server and Microsoft's Sarathi-Serve all used Python's pickle to rebuild objects received on ZeroMQ (ZMQ) sockets1. The Python documentation opens the pickle module with a warning: "The pickle module is not secure. Only unpickle data you trust."2 Oligo's account is that the construct travelled with copied code from one repository to the next1.
The bug class is old. CWE-502 defines it as deserializing untrusted data without sufficiently ensuring that the result is valid3. Our question is a different one: what unit should a defender track? When we put Oligo's write-up next to the advisories, the CVE records and the code of the time, one pattern accounts for at least eight CVE records in four projects and for none that we found in two more. The records carry different scoring vectors, and one function has two ids. The fixes come in four kinds, and one of the four is a decision not to fix.
Our claim: for this kind of infrastructure, the unit of vulnerability management should be the code pattern and its lineage. Project names and CVE ids are an index. Two of the six projects carry the pattern and have no id for it. The pattern has more than one spelling, so a fix scoped to one id misses the other spelling. Whether the pattern is remotely exploitable depends on the deployment, and an advisory cannot answer that.
01One pattern, six projects#
Each row below is one vulnerable site: the six analysed records and the two projects without one. The evidence column holds only what we read in code or advisories; where we read nothing, it says so. Commit hashes are cut to seven characters, and the commits are dated on or before 9 December 2025.
| Project | Spelling at the site | Evidence of origin | CVE | Fixed version | State on 2025-12-09 |
|---|---|---|---|---|---|
| Meta Llama Stack | recv_pyobj(), plus pickle.loads() on the result of recv_multipart()17 | No provenance comment. Oligo says this is where it first saw the construct1 | CVE-2024-5005016 | 0.0.41 per Oligo18; Meta's advisory gives a commit hash19 | Fixed: JSON20 |
| vLLM, Mooncake pipe | pickle.loads() on bytes from the transfer engine's recv_bytes()6 | Advisory names no origin | CVE-2025-29783 | 0.8.0 | Fixed: tensors moved to safetensors21 |
| vLLM, Mooncake pipe (same file) | recv_pyobj()7 | As above | CVE-2025-32444 | 0.8.5 | Fixed22 |
vLLM, shm_broadcast.py | recv() then pickle.loads()12 | Upstream of the next row | CVE-2025-30165; huntr's CVE-2024-11041 names the same function4 | None | Not fixed; V0 engine off by default since 0.8.012 |
| SGLang | Same file name, same two lines8 | First line of the file: adapted from the vLLM v0.6.4.post1 file of the same name8 | None for this site (Oligo; our search)1 | None | Partial: bind address changed on 5 May23; commit eac5b66 still uses pickle8 |
| NVIDIA TensorRT-LLM | recv() then pickle.loads(), on a line marked # nosec B30113 | No provenance comment; Oligo names no origin | CVE-2025-23254 | 0.18.214 | Fixed: HMAC added, on by default, pickle kept24 |
| Modular Max | Queue classes take pickle.loads as the default of a deserialize argument9 | Comment in the same file: the socket-opening function was adapted from vLLM and SGLang9 | CVE-2025-6045515 | 25.615 | Fixed: msgpack decoder in the KV cache agent25; no pickle in the queue file at the 25.6 tag26 |
| Microsoft Sarathi-Serve | recv_pyobj()27 | README: the repository started as a fork of vLLM28 | None (Oligo; our search) | None | Oligo: still vulnerable1; commit 3a210e7 still has this spelling27 |
Lineage evidence comes in three strengths#
The strongest evidence is a file that names its upstream. The first line of SGLang's shm_broadcast.py is a URL that points to the file of the same name in vLLM v0.6.4.post18. This is the line Oligo cites1. We compared the upstream file at that tag: the socket for remote subscribers binds to all network interfaces, and received data goes straight to pickle.loads()29. SGLang's copy also bound to all interfaces until 5 May 202523. The copy inherited the bind address along with the feature.
The Modular evidence needs care. Oligo says Max Server borrowed logic from both vLLM and SGLang1. The pre-fix zmq_queue.py does carry a comment that lists one vLLM file and one SGLang file by URL9. That comment sits on the helper function that opens a socket; the pickle.loads default is in the queue classes of the same file. The two functions that the comment names only create a socket and set its options, and neither contains pickle1011. So the helper was adapted, and nothing we read shows where the pickle default came from.
The weakest evidence is a statement about the whole repository. Sarathi-Serve's README says it started as a fork of the vLLM project and is a research prototype28. The pattern did not come with the fork: a Sarathi-Serve commit of 25 July 2024, "Add zmq based communication (#30)", adds the ZeroMQ sockets and the recv_pyobj() calls to the engine and worker files, and names no source30. The engine uses PUB and PULL sockets, where vLLM's shm_broadcast.py at v0.6.4.post1 uses XPUB and SUB2729.
The order of discovery is not the lineage of the code. Oligo first noticed the construct in Llama Stack. It attributes the spread to code reuse in general and names SGLang and Modular as examples; it does not say that the other projects copied Llama Stack1. We read no provenance comment in the Llama Stack or TensorRT-LLM files, and the three projects use different socket types: DEALER and ROUTER in Llama Stack, XPUB and SUB in vLLM, PAIR in TensorRT-LLM172913. Our judgement: copying carried the pattern across one link, from vLLM to SGLang. Modular adapted a helper that holds no pickle, and Sarathi-Serve added the pattern in a commit of its own. For Llama Stack and TensorRT-LLM we read no evidence of copying; we did not compare their commit histories with other projects, so we do not call them independent. A commit message that names a source would overturn this.
Three times in one project#
vLLM published three advisories for pickle over ZeroMQ in 48 days: 19 March, 29 April and 6 May 2025. The advisories credit three different reporter accounts6712. The first two concern the same file.
The first says that the Mooncake pipe passed raw network bytes to pickle.loads()6. In version 0.8.4, after that fix, tensors travel as safetensors and the pickle import is gone. In the same file, acknowledgements and length messages are still received with recv_pyobj(), and the bound sockets still listen on all interfaces21. Both calls were already in the file at the commit that the first advisory links, and one of them is inside recv_bytes(), on the path that the first advisory describes31. Six weeks later the second advisory names one of them and scores it 10.07. In version 0.8.5 the file has no recv_pyobj() and binds to a named host22.
Our reading: the first fix was scoped to the reported call. A fix scoped to the pattern would have asked how many routes lead from a socket to pickle in this file, and the second CVE would not have waited for another reporter.
The project's advisories are not the whole record. On 20 March 2025 two more vLLM CVE records were published with huntr, a bug bounty platform, as assigner. CVE-2024-11041 names MessageQueue.dequeue() in version 0.6.24; in that version the function is in shm_broadcast.py and holds the two lines that CVE-2025-30165 names seven weeks later3212. CVE-2024-9053 names cloudpickle.loads() in the RPC server of version 0.6.05; that file reads its messages from a ZeroMQ DEALER socket33. We read only that one file for it, so it is not in our tables.
02Three spellings of one pattern#
The pyzmq documentation says that recv_pyobj() is a basic wrapper around pickle.loads(recv()), and that calling it trusts incoming messages with arbitrary code execution34. pyzmq added its warnings on 15 October 2024, after the Llama Stack report35. So the first two spellings below are the same at run time.
| Spelling | What it looks like | Seen in | Does a search for recv_pyobj find it? |
|---|---|---|---|
| Convenience method | sock.recv_pyobj() | Llama Stack, vLLM (CVE-2025-32444), Sarathi-Serve | Yes |
| Two steps | data = sock.recv(), then pickle.loads(data); in Mooncake the bytes come from recv_bytes(); vLLM's RPC server called cloudpickle.loads() | vLLM (CVE-2025-30165, CVE-2025-29783, CVE-2024-9053), SGLang's copy, TensorRT-LLM, the worker side of Llama Stack | Not the named call. In the Mooncake file it hits two other calls |
| Injected deserializer | A queue or socket wrapper takes a deserialize argument whose value is pickle.loads | Modular Max | Not the site that the CVE names; the call site does not contain the word pickle |
The third spelling is the easiest to miss, as Modular's own fix shows. Before the fix, any call site that left the argument out inherited pickle9. The commit of 30 July removed the default from the Push and Pull classes. It left one call that passes pickle.loads explicitly, with the comment "This remains the only use of pickle in the current codebase."36 The commit of 13 August replaced that call25. The CVE record links three fix commits, dated 30 July and 13 August15.
We read on. At the last of those three commits, dispatcher_service.py in the KV cache agent directory still takes pickle.loads as a constructor default and passes it to a Pull socket37. The factory that builds it does not pass the argument, and the endpoints are generated ipc:// paths38. On 4 September a refactoring commit put pickle.dumps and pickle.loads back as defaults in the signatures of the Push and Pull classes. Every call site that the commit touches passes the argument explicitly: the call that the CVE names keeps a msgpack decoder, and the dispatcher still passes its own constructor argument39. So the default returned; we saw no caller that relied on it, and we did not search the whole tree at that commit. A commit of 17 September removed pickle from the queue file40, and the file has none at the 25.6 tag, released on 22 September26. That agrees with the fixed version in the CVE record.
The TensorRT-LLM line carries one more mark: # nosec B30113. B301 is the rule id that the static analyser Bandit uses for pickle calls41. We read this as a tool warning that someone silenced. We do not know the reason.
03Remote exploitation needs three conditions at once#
This is the model we use to read the advisories. When all three conditions hold, whoever can deliver bytes can run code in the reader. Remove one and the route is closed.
- 01
C1 A reachable socket
The attacker can deliver bytes to the reader. This depends on the bind address, the transport, the direction of the connection and the deployment.
Depends on deployment - 02
C2 A deserializer that executes code
The reader hands the bytes to a format such as pickle.
Visible in code - 03
C3 No authentication on the channel
Nothing confirms that a message comes from a trusted peer before it is deserialized.
Visible in code
C2 holds at all eight sites, and C3 held at all eight before any fix. Almost all of the difference is in C1. The C1 column holds only what the advisory or the code says.
| Site | C1 according to the advisory or the code | Vector in the advisory |
|---|---|---|
| Llama Stack | Meta: pickle was used for socket communication19. In the commit that Oligo links, the request socket binds to 127.0.0.1 on a random port17 | AV:N, PR:L, 6.3, from the CISA-ADP container of the CVE record16 |
| vLLM, CVE-2025-29783 | With Mooncake enabled, the pipe crosses hosts over TCP by design; the advisory sees no network or authentication control6 | AV:A, PR:L |
| vLLM, CVE-2025-32444 | The advisory: the sockets listened on all network interfaces7. In the file the bound sockets are the PUSH side; the PULL socket that the advisory names connects to the peer21 | AV:N, PR:N, 10.0 |
| vLLM, CVE-2025-30165 | V0 engine only, with tensor parallelism across hosts. The vulnerable side is a client that connects to the primary host; an attacker must first control the primary, or redirect traffic by a method such as ARP cache poisoning12 | AV:A, PR:L, 8.0 |
| TensorRT-LLM | NVIDIA: the attacker needs local access to the server14. The default address in 0.18.1 is tcp://127.0.0.1:*13 | AV:L, PR:L, 8.8 |
| Modular Max | Only when --experimental-enable-kvcache-agent is in use15; the commit message speaks of pickle deserialization on open ports25 | AV:L, PR:N, 8.4, from CISA-ADP15 |
| SGLang | In multi-node use the remote socket bound to all interfaces, and to connect_ip from 5 May23. At commit eac5b66, when no value is given, the address comes from get_local_ip_auto("0.0.0.0")8; that function returns the fallback it was given when every detection method fails42. A project collaborator says isolated clusters are not affected43 | No CVE |
| Sarathi-Serve | Two engine sockets bind to tcp://*27 | No CVE |
The direction of the connection is part of C1. vLLM's CVE-2025-30165 is not a listener problem: the secondary hosts connect out to the primary and deserialize what it sends12. An inventory of listening ports does not show it. The Mooncake reader sockets connect out as well21.
The transport changes with the caller. Modular's pre-fix queue classes generate an ipc:// path when no endpoint is given and also accept a tcp:// endpoint9. The TensorRT-LLM queue binds to loopback by default, and its address is a constructor argument13. For one class, the answer to C1 depends on who calls it.
Advisory scores and the researchers' account do not match#
- TensorRT-LLM. Oligo writes that the CVE was "Rated Critical (9.3) by NVD"1. The NVD page, in the archive copy of 24 November 2025, shows no score from NVD itself. It shows NVIDIA's 8.8 with AV:L, and a last-modified date of 2 May 202544.
- Llama Stack. Oligo says an attacker can execute code from the network and cites Snyk's 9.3 under CVSS 4.0; it attributes a 6.3 score to Meta18. In the CVE record the 6.3 sits in the CISA-ADP container, and Meta's own container has no score16. Oligo's proof of concept first looks for ZMQ ports on the same host and notes that remote hosts can be scanned too18.
- vLLM. Oligo's timeline lists CVE-2025-30165 as fixed by making the safe V1 engine the default, and advises 0.8.0 or later1. The advisory says "we have decided not to fix this issue" and recommends a secure network. It scores the function 8.0 with AV:A and PR:L12; huntr's CVE-2024-11041 scores the same function 9.8 with AV:N and PR:N4.
- Modular. Oligo's timeline says June 2025 and a quick patch1. The public issue was opened on 11 June, and Modular replied on 15 August that a proposed fix had landed45. Version 25.6, the fixed version in the CVE record, was released on 22 September26, and the CVE was published on 18 November15.
- Exposure count. Oligo says it found thousands of ZMQ sockets exposed on the internet, with no exact figure and no date1. An exposed socket is not proof of pickle behind it. The figure is an upper bound on C1, not a count of vulnerable servers.
We think several of these differences come from C1. NVIDIA scored the default configuration, which is loopback, and the vLLM project scored CVE-2025-30165 for a cluster network. Oligo and huntr scored a deployment in which the socket is already exposed. Not every score is a vendor's: the Llama Stack and Modular vectors come from CISA's enrichment of the CVE record, and the Llama Stack one is already AV:N, with a lower score because of PR:L and low impact values1615. Both frames are valid. So a CVSS score cannot tell a team whether its own deployment is reachable. If evidence showed that a project scored AV:L listens on all interfaces in its default configuration, this reading would need revision.
04Which condition each fix changed#
Oligo reports Llama Stack to Meta18
ReportLlama Stack fix commit: socket messages move to JSON20
FixCVE-2024-50050 published (date in the CVE record; Oligo gives 24 October)16
CVEvLLM advisory for CVE-2025-29783, fixed in 0.8.06
CVEOligo's researcher opens a public SGLang issue. It says a security contact was requested more than two months earlier and a report was then sent by email43
ReportSGLang merges a fix that changes only the bind address23
Partial fixvLLM advisory for CVE-2025-30165: no fix12
CVEModular replaces pickle in the KV cache agent with a msgpack decoder25
FixA Modular refactor restores pickle as a default in the signatures of two queue classes39
Default returnsOligo publishes ShadowMQ1
DisclosureCVE-2025-60455 published15
CVEAn SGLang collaborator says a fix with HMAC or safer deserialization will follow43
Statement
We sort the fixes by the condition they change.
| Type | Changes | Cases | What remains |
|---|---|---|---|
| F1 Replace the deserializer | C2 | Llama Stack moves to JSON20; Modular to msgpack25; vLLM Mooncake tensors to safetensors21 | The pattern is gone. Check the same file for another spelling, and check that a later refactor does not bring it back |
| F2 Authenticate, then deserialize | C3 | TensorRT-LLM 0.18.2: HMAC-SHA256 over the pickled bytes, verified before loading24 | pickle stays. Safety rests on how the key travels and on the option staying on |
| F3 Narrow reachability | C1 | SGLang moves the remote socket from all interfaces to connect_ip23 | C2 and C3 are unchanged. The flaw returns when the network assumption fails |
| F4 Retire the path, leave the code | A default | vLLM CVE-2025-30165: V0 off by default, with advice to use a secure network12 | The code is still there |
NVIDIA's bulletin calls its F2 change HMAC encryption and says that customers can disable it, which makes them vulnerable again14. In the 0.18.2 code it is message authentication. The server creates a key with os.urandom(32) and hands it to the client together with the address. The receiver compares digests with hmac.compare_digest and only then calls pickle.loads(). With the option off, the code falls back to recv_pyobj()24. The Python documentation gives the same advice2.
The F3 pull request states its premise: security now relies heavily on network segmentation, and multi-node communication is assumed to stay inside trusted clusters23. vLLM's security documentation says the same of its own design: communication between nodes in a multi-node deployment is "insecure by default" and must be protected by an isolated network46.
For F4, at the v0.10.0 tag, vLLM's shm_broadcast.py still has the remote sockets, and its receive function still calls pickle.loads()47. The advisory says the V1 engine is not affected12. We did not trace which execution paths reach this code, so we draw no conclusion on exploitability. The fact we record: after a path is retired, the pattern remains in the file, and code forked from that version carries it.
Our standard for a fix is this: for every route from a socket to a deserializer, C2 or C3 is false in the code, and not because of deployment settings. By this standard F1 and F2 are fixes, and F3 and F4 are mitigations. The pyzmq documentation lists three protections: CURVE encryption and authentication, IPC socket permissions, and message authentication such as HMAC digests before deserializing34.
05The same conditions through other doors#
The cases below are not part of the ShadowMQ lineage. We know of no code that they share with it, and we claim no link. We put them in the same model to see which condition moved.
| Case | Entry (C1) | What executes (C2) | Authentication (C3) | Outcome |
|---|---|---|---|---|
PyTorch torch.load, CVE-2025-32434 | A model file that the user loads | A PyTorch model file is basically a compressed pickle file48; the advisory says weights_only=True could still lead to remote command execution49 | None; nothing verifies where the file came from | Fixed in 2.6.0 |
| nullifAI models on Hugging Face | A file downloaded from a model hub | pickle executes opcodes in sequence; a payload at the start runs before deserialization fails48 | The hub's scanner, Picklescan, did not flag them | Removed within 24 hours of the report; scanner updated |
| Langflow, CVE-2025-3248 | The HTTP endpoint /api/v1/validate/code | Python exec on submitted function definitions50 | The endpoint needed no authentication | 1.3.0 puts it behind authentication; added to CISA KEV on 5 May51 |
| Ray, CVE-2023-48022 | The job submission API on the dashboard | Submitting a job is running code, by design52 | No built-in authentication | Disputed53; Oligo says there is no version to upgrade to54 |
| NVIDIA Triton, CVE-2025-23319 and two more | The public inference API | Not a deserializer: the attacker gains read and write access to the Python backend's internal shared memory55 | The shared-memory API does not check who owns a key | Fixed in 25.07 |
Model files. Here C1 is a file, and the defence sits at C3: scan before loading. ReversingLabs reported in February 2025 that two malicious models were compressed with 7z and were not flagged by Picklescan. It also showed that the scanner raised an error on a broken pickle file but did not report the dangerous functions that came before the break48. Sonatype published four Picklescan CVEs in March56, and JFrog three more on 2 December57. JFrog states the premise that such a scanner depends on: it must interpret a file exactly as PyTorch would57. In our view a denylist scanner is a weaker form of F2 than HMAC: HMAC verifies the origin, and a scanner guesses at the content.
Langflow. Horizon3.ai says the vulnerable code had been present since the earliest versions, two years before50. The patch is F2. Horizon3.ai also notes that regular users can execute code on the server by design.
Ray. Anyscale said in November 2023 that the absence of built-in authentication "is a long-standing design decision" and that it does not consider it a vulnerability. In its account, Ray's security boundary is outside the cluster, and users must prevent access from untrusted machines. It also said that it intended to add authentication later as defence in depth52. NVD marks the CVE as disputed53. On 18 November 2025 Oligo reported that the flaw was still being exploited and that more than 230,000 Ray servers were exposed to the internet. Another passage of the same post says over 200,000, with Shodan as the source. Both count exposed servers. Oligo says a portion were vulnerable or compromised and some were honeypots, and gives no number for either54. Three days later Ray 2.52.0 added token authentication, off by default58.
Our summary: in these cases the component that executes code is mostly the feature itself. The vLLM and Ray documents both draw the security boundary outside the component4652. The flaw appears where that boundary was assumed and was not there.
06A white-box variant-analysis procedure#
This procedure is for teams that run or build on these frameworks. It uses only the source and configuration you hold. We have not run it in a lab; we derived it from the advisories and code above.
Search: three spellings and silenced warnings#
- Search for the convenience methods:
recv_pyobj,send_pyobj. - Search for the deserializer itself:
pickle.loads,pickle.load,Unpickler, and wrappers such ascloudpickle.loads, the call at vLLM's CVE-2024-9053 site5. Bandit's B301 rule puts modules that wrap pickle, such asdill, in the same class41. PyTorch saves and loads models with pickle by default57, so includetorch.load. - Search for deserializers passed as values: signatures and defaults of arguments named like
deserialize,loadsordecoder. Modular's flaw was in a default9. - Search for silenced warnings:
nosec, and B301 in particular13. Each one needs a fresh justification from a named person. - Cover your dependencies and the versions installed in your container images, not only your own repository.
Decide reachability#
For each hit, trace where the data comes from and record four things: bind or connect, the transport, the address, and which start-up options change the first two. We record five levels. The levels and the third column are our own classification, from how each transport works in general; we tested none of them.
| Level | Transport and address | Who can deliver bytes |
|---|---|---|
| R0 | inproc:// | The same process |
| R1 | ipc:// path | Local processes with file permission on the path34 |
| R2 | tcp://127.0.0.1 | Any local process, including containers that share the network namespace |
| R3 | tcp:// with a named address | Any host on that network segment |
| R4 | tcp://* or 0.0.0.0 | Anyone who can route to the host |
Mark the connecting side separately. Its C1 depends on whether the peer is trusted and on whether the network between them can be redirected, as in vLLM's CVE-2025-3016512. Confirm the level on the real deployment: one Modular class can be R1, R3 or R4, depending on the endpoint that the caller passes9.
Confirm which condition the fix changed#
- Read the diff of the fix, not only the version number. Assign it to F1 to F4.
- F1: repeat the search from the previous section in the same file and the same class. Mooncake's second CVE was in a file that had already been fixed once21.
- F2: confirm that verification happens before deserialization, that the key does not travel on the same channel, and that the option defaults to on. Treat disabling verification as a configuration change that needs approval14.
- F3 and F4: record them as mitigations. Write down the network assumption, an owner and a date for the next check.
- Add a test that must fail closed: send the reader an unauthenticated message and assert that the deserializer was not called. Modular's default came back in the class signatures about five weeks after its removal39.
Forks and vendored copies#
- Search for provenance comments such as Adapted from, Copied from or Based on. The tag or commit hash in the comment is the upstream version to compare against89.
- Where there is no comment, match file names and function names against the upstream. SGLang's file kept its name8.
- An upstream fix does not reach a copy through a version upgrade. For each copy, follow the upstream's security advisories and record the copy's state at each upstream fix.
- When the upstream decides not to fix (F4), the copy's maintainer has to do F1 or F2.
- A fork without a CVE is not a fork without the flaw. Oligo calls such cases shadow vulnerabilities1.
Keep one record for each hit.
pattern_id deser-over-channel
component <repository>@<commit> <path>:<line>
spelling recv_pyobj | recv+loads | injected-deserializer | file-load
origin own | adapted-from <repository>@<ref> | fork-of <repository> | vendored <package>@<version>
upstream_advisory <GHSA or CVE, or none>
upstream_fix_type F1 | F2 | F3 | F4 | none
C1_reachability R0..R4 bind|connect <transport> <option that changes it>
C2_deserializer pickle | dill | torch.load | <safe format>
C3_authentication none | HMAC(<key source>) | CURVE | mTLS
decision remove | authenticate | isolate | accept
owner_and_expiry <owner> <date of next check>
recheck_on upgrade | config-change | new-deployment-mode