Manuscript Offprint
arXiv:2611.08745I Don't Care How You Hide It, I Care What You Do: Runtime Detection of Malicious ML Models
Hala Ali
Virginia Commonwealth University, USA
Andrew Case
Volatility Foundation, USA
Abstract—Pre-trained machine learning (ML) models shared through public platforms can be weaponized to execute malicious payloads during loading or inference. Existing scanners prove inadequate for detecting malicious models as they rely on static analysis and function denylists, support limited serialization formats, and miss attacks that replace denylisted functions with equivalent alternatives, exploit unsupported loading paths, or abuse legitimate framework APIs. To address this problem, we present MODELSHIELD, the first runtime behavioral detection system for malicious ML models that attributes observed system-level behavior to specific model operations. It combines application-level instrumentation of ML framework APIs with eBPF-based syscall tracing, tracking model behavior across spawned threads and child processes to separate model-triggered activity from environment noise. Attributed syscall sequences are classified using 195 detection patterns mapped to MITRE ATT&CK techniques. We implemented MODELSHIELD to support 17 ML frameworks and 36 formats. On an independent dataset, it is the only evaluated tool to achieve zero false positives, with false negatives limited to payloads that produce no malicious runtime behavior. It detected all 29 published evasion variants spanning function substitution, loading-path obfuscation, and TensorFlow API abuse, where no existing scanner achieved complete coverage. Across 145,000 models scanned from public platforms, it captured 41 malicious models on Hugging Face, including a reverse-shell payload and a payload that performed host reconnaissance and outbound exfiltration. Among these, ModelScan, PickleScan, Fickling, and ModelAudit detected only 29%, 56%, 80%, and 93%, respectively. Despite runtime overhead, MODELSHIELD achieves a median analysis time of 12.3 seconds, with 90% of scans completing within 35.5 seconds, making it practical for hub-scale screening.
Index Terms—Machine Learning Security, Malicious ML Models, Runtime Behavioral Detection, System Call Tracing
1. Introduction
Pre-trained machine learning (ML) models are commonly shared through public platforms such as Hugging Face [1], Kaggle [2], ModelScope [3], TensorFlow Hub [4], and Keras Hub [5]. While adopting these models reduces the time, cost, and expertise required to deploy ML systems [6]–[8], it introduces security risks. ML models can encapsulate learned parameters, architecture, and computational logic, allowing attackers to embed malicious code that is triggered during loading or inference [9], [10].
Existing static scanners rely on limited and inconsistent denylist rules, resulting in varying detection results across tools. For instance, PickleScan [11], which is used in Hugging Face's built-in pickle scanning pipeline [12], focuses on pickle-based serialization formats. ModelScan [13] supports additional formats such as H5 and TensorFlow SavedModel, but still relies on predefined lists of unsafe functions, imports, and operators. Recent work has shown that these scanners fail against evasion techniques that replace commonly denylisted functions, such as os.system, eval, and exec, with functionally equivalent alternatives from Python's standard library or common ML dependencies. These techniques also exploit loading paths that scanners do not fully support, including nested archives, compression layers, framework-specific packaging formats such as zip, tar, gzip, bz2, and xz, and craft malformed pickle bytecode or archive structures that trigger parser exceptions in scanners while remaining loadable by the framework [14]. Beyond pickle-based formats, attackers can also abuse legitimate framework APIs, such as TensorFlow SavedModel operations (e.g., FixedLengthRecordDatasetV2 and DebugIdentityV3), to perform file leakage, IP exposure, code execution, and shell access [15].
Addressing these gaps within the current scanners is challenging. Blocking legitimate framework APIs is impractical as benign models and standard ML workflows depend on them [16]. Expanding denylists to include broader Python standard-library functions or ML dependencies is also insufficient, since the same function can be benign or malicious depending on its arguments and runtime effects [17]. Moreover, extending scanner support to all possible loading paths and container formats imposes a continuous maintenance burden as frameworks evolve. Although sandboxing is recommended for executing untrusted models [18], a sandboxed trace does not inherently determine whether an observed syscall originated from the model artifact, the ML framework, or the execution environment itself [19].
Therefore, we present MODELSHIELD, the first runtime behavioral detection system for malicious ML models that attributes observed system-level behavior to specific model operations. Unlike existing scanners, which flag models containing suspicious or denylisted callables regardless of runtime effect, MODELSHIELD reports a model as malicious only when it produces an observable harmful action. This complements static analysis, which remains necessary for payloads that never execute, while avoiding false positives from dormant or benign uses of flagged functions. MODELSHIELD combines application-level instrumentation of ML framework APIs with eBPF-based syscall tracing to link each captured syscall to the model loading or inference operation that triggered it. This attribution is preserved across threads and child processes, separating model-triggered behavior from framework and execution-environment noise. The attributed syscall sequences are then classified against a taxonomy of 195 detection patterns mapped to MITRE ATT&CK [20]. To capture behaviors not covered by the taxonomy, the syscall traces are further analyzed offline by an LLM to identify candidate patterns, which are manually reviewed before inclusion.
We implemented MODELSHIELD to support 17 ML frameworks and 36 formats. On the PickleBall evaluation dataset [17], MODELSHIELD is the only evaluated tool to achieve zero false positives; its false negatives arise from payloads that never execute or produce no malicious behavior during analysis, not from classification errors. It detected all 29 published evasion variants covering function substitution, loading-path obfuscation, and TensorFlow API abuse, where no static tool achieved complete coverage. On a large-scale scan of 105,000 Hugging Face, 30,000 ModelScope, and 10,000 Kaggle models uploaded between March 25 and May 5, 2026, it detected 41 malicious models on Hugging Face, including two real-world malware samples. The first is a reverse-shell payload that remained undetected for three days after upload, with 108 downloads at detection time; the second performed host reconnaissance and outbound exfiltration. Among these, ModelScan, PickleScan, Fickling, and ModelAudit detected only 29%, 56%, 80%, and 93%, respectively. DynaHug [19], a recent dynamic approach, could analyze only 12% as it is limited to PyTorch formats and loading-phase monitoring. Although slower than existing scanners due to runtime analysis overhead, MODELSHIELD achieves a median analysis time of 12.3 seconds per model, with 90% of scans completing within 35.5 seconds, making it practical for hub-scale screening.
To summarize, we make the following contributions:
-
We introduce MODELSHIELD, the first runtime behavioral detection system that attributes syscall activity to specific model loading and inference operations.
-
We design a dual-layer architecture combining AOP-based framework instrumentation with eBPF syscall tracing, propagating correlation across threads and child processes.
-
We develop a taxonomy of 195 detection patterns across eight attack classes mapped to MITRE ATT&CK, extended via offline LLM-based discovery.
-
We evaluate MODELSHIELD on the PickleBall evaluation dataset, 29 published evasion variants, and 145,000
models across three platforms, detecting 41 malicious models including two real-world malware samples, with 90% of scans completing within 35.5 seconds.
2.1. Model Serialization
Serialization converts an ML model into a persistent artifact for storage and distribution. Serialization formats vary across frameworks. For instance, PyTorch uses Python's pickle protocol within a ZIP-based container [21], TensorFlow SavedModel encodes computational graphs using Protocol Buffers with separate variable checkpoints [22], and scikit-learn models are serialized via joblib or pickle [23]. Additional formats include Keras HDF5 [24], ONNX Protobuf [25], and weight-only formats such as SafeTensors and GGUF. Loading, or deserialization, reconstructs the model via a framework API call such as torch.load() or tf.saved_model.load(). These APIs read the artifact, rebuild the model structure, restore the parameters, and return a model ready for inference.
2.2. Instrumentation Primitives
Aspect-Oriented Programming (AOP) is a programming paradigm that enables runtime interception of function calls without modifying source code [26], [27]. A join point is a program event that can be intercepted, such as a function call; a pointcut specifies which join points to intercept; and advice is the additional behavior executed at those points. AOP is well suited for instrumenting ML framework APIs, as it enables attaching contextual metadata at specific function boundaries to attribute observed syscalls to the model operations that triggered them. At the kernel layer, all interactions with the operating system pass through the system call interface, providing an effective observation point for detecting malicious behavior [28]. Extended Berkeley Packet Filter (eBPF) [29], [30] is a Linux kernel subsystem that allows user-space programs to run inside the kernel in response to specific events, such as syscall entry and exit tracepoints, capturing system calls and their arguments with minimal overhead [31]. eBPF also provides kernel-resident maps for sharing state between user space and kernel probes, and perf event buffers for streaming captured events to user space. Unlike ptrace [32], eBPF programs are invisible to the monitored process, preventing detection or evasion by malicious payloads.
2.3. Threat Model
Adversary Goal. The adversary targets downstream users by distributing malicious model artifacts through public platforms. Once downloaded, the embedded payload executes automatically during model loading or inference. Adversary Capability. The adversary can publish models on public platforms and knows the limitations of existing platform scanners. Based on this, it can embed malicious payloads within model artifacts and develop or adopt evasion techniques to bypass platform-side detection. It can also verify evasion by testing artifacts against static scanners before publication. Assumptions. The payload has no prior access to the victim environment, is triggered only when the model is loaded or executed by the victim, and runs with the privileges of the model-running process. The adversary has no prior root- or kernel-level access to tamper with the host kernel, ML framework, or MODELSHIELD; defending against post-exploitation tampering following privilege escalation is outside the scope of this work.
3. Related Work
Static Analysis Approaches. Kellas et al. [17] proposed PickleBall, which analyzes ML library source code to identify callables required to load a given model class and enforces them as an allowlist at load time. Although it blocks the evaluated malicious payloads, it fails to load 20% of benign models, highlighting the difficulty of building complete allowlists across ML libraries. Zhao et al. [33] proposed MalHug, which applies taint analysis and heuristic pattern matching to suspicious code extracted from model files and dataset loading scripts on Hugging Face, identifying 91 malicious models across more than 705K analyzed models. Zhu et al. [15] focused on detecting TensorFlow SavedModel API abuse; they proposed parsing the computational graph to identify exploitable operations and inspecting their parameters, such as file paths and network endpoints, for suspicious usage.
Dynamic Analysis Approaches. Casey et al. [10] combined Python-level tracing via sys.settrace with strace to monitor model behavior during loading only, focusing on suspicious syscalls such as socket, connect, execve, and chmod, which were then reviewed manually. However, 84% of flagged models were false positives because this approach lacks the context to distinguish malicious from benign syscall usage. Ravia [34] similarly proposed loading models in a sandbox and flagging individual anomalous syscalls and glibc calls, such as process creation or network connections. Nambiar et al. [19] proposed DynaHug, which executes models in a Docker sandbox, collects strace logs during deserialization, and trains a one-class SVM on syscall presence and frequency features from benign models grouped by task tag (e.g., text-generation). However, it targets only PyTorch pickle models, monitors only the loading phase, trains on all captured syscalls without distinguishing model-triggered behavior from framework and environment noise, and requires a separately trained classifier for each task category.
None of these approaches identifies the origin of observed syscalls, tracks model behavior across spawned threads and processes, or provides the semantic context needed to distinguish malicious from benign usage. Their analysis is equivalent to generic sandbox monitoring.
4. Challenges
Designing a runtime behavioral detection system for ML models introduces five key challenges.
C1. Monitoring and Instrumentation Constraints. Although eBPF enables low-overhead syscall tracing, its kernel verifier enforces strict constraints on stack size, instruction count, and memory access, limiting in-kernel processing. Model execution can generate thousands of syscalls in short bursts, risking event-buffer overflow. Additionally, malicious payloads may crash or hang the model process, requiring isolation to keep the monitoring system running and continuous buffer draining to prevent event loss on abrupt termination.
C2. Syscall Attribution Ambiguity. A single API call, such as torch.load(), can generate thousands of syscalls from framework internals, CUDA initialization, third-party packages, and the dynamic linker. At the kernel level, these syscalls are indistinguishable, making it difficult to determine which activity is triggered by the model artifact, and which belongs to the surrounding environment.
C3. ML Framework Concurrency. Modern ML frameworks heavily rely on concurrency, distributing work across multiple threads and child processes. For instance, PyTorch supports multiprocessing workers for data loading, while TensorFlow uses thread pools for execution of operations. However, thread pools reuse threads across unrelated tasks, forked processes receive new identifiers, and Python does not natively carry context into thread-pool workers. These factors make it difficult to track model behavior.
C4. Behavioral Pattern Matching and Design Trade-Offs. Even after attribution, matching syscall sequences against detection patterns is challenging. Unrelated syscalls from different threads can appear adjacent in a single time-ordered stream and be incorrectly matched as a malicious sequence. However, restricting matching to per-thread traces misses attacks that intentionally span threads or processes. Pattern granularity also involves trade-offs, as specific patterns improve precision at the risk of missing attack variations, whereas general patterns increase coverage at the cost of false positives. These difficulties are compounded by the varying lengths of attack sequences, from the short syscall burst of a reverse shell to the long repetitive cycles of ransomware encryption.
C5. Model and Execution Heterogeneity. ML models span diverse frameworks and serialization formats, each with different threat surfaces. Some formats prevent code execution by design (e.g., SafeTensors), while others permit arbitrary execution during deserialization (e.g., pickle). Therefore, the same syscall behavior carries different security implications depending on the format. For instance, extensive file I/O during a SafeTensors load is benign, whereas the same behavior during pickle deserialization may indicate payload execution. Even within a single format, the same syscall behavior can be benign or suspicious depending on context, such as accessing /proc/cpuinfo for hardware detection versus host reconnaissance. Heterogeneity also affects input inference, as malicious code may trigger only under specific inputs, yet model metadata is often incomplete or missing.
5. Methodology
Figure 1 presents the MODELSHIELD architecture, which spans user space and kernel space across five components: ① format and input resolution, ② application-level instrumentation, ③ kernel-level monitoring, ④ event processing, and ⑤ attack behavior classification.
5.1. Format and Input Resolution
Given a model downloaded from a public platform, MODELSHIELD resolves its serialization format and infers the input requirements needed for inference, addressing challenge C5.
Format Resolution. MODELSHIELD first parses available model metadata, such as configuration files that declare the framework, architecture class, and hyperparameters, to constrain the set of candidate formats. It then matches each model file's extension against 36 supported formats (Table 1). When an extension maps to multiple formats, for instance, .bin may correspond to a ZIP-packaged pickle, a TorchScript archive, or a raw pickle stream, MODELSHIELD inspects file headers and magic bytes to resolve the format. When a model spans multiple files, such as a Keras architecture JSON with separate HDF5 weights, MODELSHIELD resolves the dependencies and sequences the loading steps accordingly. Before loading, structural validation flags files smaller than 1KB as payload-only artifacts, checks for poly-glot signatures where a single file matches multiple format types, detects embedded executables such as ELF binaries or shell scripts, and cross-checks declared metadata against the detected framework.
Input Generation. MODELSHIELD infers input requirements from multiple sources in priority order. It first extracts metadata fields (e.g., model_type, architectures, image_size, and vocab_size) to determine the expected modality and shape. When metadata is incomplete or absent, it falls back to framework-specific defaults (e.g., tabular feature vectors for gradient-boosting models, tensors shaped to common defaults for ONNX and TFLite), followed by folder-name heuristics matching keywords (e.g., bert, vit, or whisper) to their respective modalities. It then generates a synthetic input of the appropriate type and shape, such as a random image tensor for vision models, a token sequence for text models, a waveform tensor for audio models, or a tabular feature vector for classical ML models. For formats where payloads trigger during deserialization (e.g., pickle, dill, and NumPy with object arrays), no input is required.
5.2. Application-Level Instrumentation
Following format resolution and input generation, MODELSHIELD loads and runs the model with application-level instrumentation, addressing challenges C2 and C3.
Join Points and Advice. MODELSHIELD applies dynamic weaving at the function level via runtime function interposition. Each framework's loading and inference APIs, listed in Table 1, are replaced at import time with instrumented wrappers that preserve the original function signature and logic. After the loading API returns, the wrapper inspects the returned model object via runtime reflection and instruments its callable methods, such as generate, decision_function, and apply, ensuring coverage of entry points unknown at instrumentation time.
Correlation Context. When an instrumented framework API (e.g., torch.load()) is called, the AOP wrapper writes a correlation identifier and the current phase (LOADING or EXECUTION) into a BPF hash map keyed by the caller's kernel thread identifier. The wrapped call then executes on that same thread, ensuring that every syscall it issues enters the kernel with that thread identifier. At each syscall tracepoint, the eBPF probe in Stage ⑧ looks up the thread identifier in the BPF map and retrieves the correlation context. The phase tag is propagated to the classifier in Stage ⑤, which matches attack patterns separately for loading and inference, as the same syscall sequence may be benign during loading but malicious during inference.
Propagation Across Concurrency Boundaries. MODELSHIELD propagates correlation context across threads and processes through three complementary mechanisms. First, eBPF probes on clone and fork copy the parent's BPF-map entry to the child at creation time, enabling propagation across kernel-visible boundaries without user-space involvement. Second, Python thread-pool submission is intercepted to initialize each worker's map entry before task execution, preventing the reuse of stale context from previous tasks. Third, a user-space genealogy store records parent-child relationships, enabling retroactive attribution of events whose kernel context was not yet established at capture time.
Execution Isolation. MODELSHIELD executes the model in a forked process with resource limits on CPU time, memory, file descriptors, and child-process count. The parent process concurrently polls and drains the kernel event buffer, ensuring that events are captured even if the child terminates abnormally due to crashes, sys.exit() calls, or malicious behavior. Continuous draining also prevents buffer overflow during high-volume syscall bursts generated while the model runs.
5.3. Kernel-Level Monitoring
While the AOP layer provides semantic context at the application level, the capture of system-level behavior occurs in the kernel via eBPF, addressing challenge C1.
Tracepoint Coverage. MODELSHIELD attaches eBPF programs to syscall entry and exit tracepoints covering eight categories spanning system, file, network, process, memory, permission, code execution, and kernel module operations. On each tracepoint call, the program filters by the set of monitored process identifiers maintained in a BPF map, discarding calls from unrelated processes. The complete list of traced syscalls is provided in Table 9 in the appendix.

Figure 1. Overview of the MODELSHIELD Architecture.
Event Encoding. Given the eBPF verifier constraints (challenge C1), each captured syscall is packaged into a fixed-size record, referred to as an event, containing an 8-bit operation identifier that specifies the syscall and the syscall's raw arguments (e.g., file descriptors, flags, pointers). Accordingly, argument decoding, flag interpretation, and semantic labeling are deferred to user space.
Event Correlation. Each captured event is tagged with the correlation identifier and phase established by the application-level instrumentation. The eBPF program retrieves these values from the shared BPF map using the current thread identifier and stores them in the event record before emission to user space. When correlation metadata is absent, for example, due to delayed context propagation, the event is emitted without attribution and resolved in user space using the multi-level strategy described in Section 5.4.
Semantic Resolution. Syscall arguments provide a limited behavioral context. For instance, read takes a file descriptor rather than a file path, and connect takes a pointer to a sockaddr structure rather than its contents. Since these references cannot be dereferenced after the tracepoint returns, MODELSHIELD extracts the underlying values in-kernel before event emission. For network syscalls, the eBPF program reads the sockaddr structure and stores the address family, raw IP bytes, and port number in the event record. For file syscalls, it maintains a per-process file-descriptor-to-path map populated at openat and consulted on subsequent read, write, and getdents64 calls.
Event Streaming. Events are emitted to user space through per-CPU perf event buffers, which provide lock-free streaming with minimal overhead. To prevent buffer over-
flow, the user-space process polls the buffer continuously during model execution. A separate thread-event buffer captures parent-child events emitted by clone and fork probes, recording the parent's correlation context, parent and child identifiers, and the creation timestamp. These events feed the genealogy store that supports retroactive attribution of syscalls from worker threads and child processes.
5.4. Event Processing
This stage processes the events received from the eBPF layer through the following steps.
Syscall Mapping and Decoding. The operation identifier is mapped to its syscall name and to a two-level semantic label consisting of a category (e.g., File, Network, Process) and a sub-operation (e.g., File.open, Network.connect). This allows attack patterns to match semantically equivalent operations regardless of the specific syscall variant. The raw arguments are then decoded into structured fields. Integer flags are mapped to their symbolic constants (e.g., open modes, memory-protection bits, socket families), and network addresses are normalized so that equivalent endpoints, such as IPv4-mapped IPv6 addresses, are represented consistently.
Correlation Resolution. Once the event is decoded, the next step determines which model operation produced it. Since the eBPF layer emits events only from monitored processes, every event reaching this stage belongs to the model's process tree. The resolution prioritizes the correlation identifier embedded by the eBPF probe. If absent, it falls back to the thread-pool task table, followed by the genealogy
TABLE 1. SUPPORTED MODEL FORMATS AND AOP INTERCEPTION POINTS FOR THE LOADING AND INFERENCE PHASES.
| Framework | Format / Extension | Loading Intercepts | Execution Intercepts |
|---|---|---|---|
| PyTorch | .pt, .pth, .bin, .ckpt, .th(pickle, TorchScript, package, legacy) | torch.load, torch.jit.load,PackageImporter.load_pickle | __call__, forward |
| .pt2 (torch.export) | torch.export.load | __call__ | |
| TensorFlow | SavedModel directory, .pb | tf.saved_model.load | __call__, signatures |
| .h5, .keras (Keras) | tf.keras.models.load_model | __call__, predict | |
| .tflite | tf.lite.Interpreter._init__ | invoke | |
| Hugging Face Transformers | .bin, .safetensors | AutoModel.from_pretrained,TFAutoModel.from_pretrained,transformers.pipeline | __call__, forward,generate, pipeline. __call__ |
| .safetensors (standalone) | safetensors.torch.load_file,safetensors.numpy.load_file,safetensors.tensorflow.load_file | delegated to framework(e.g., PyTorch, TensorFlow) | |
| ONNX Runtime | .onnx | onnx.load,ort.InferenceSession._init__ | run |
| XGBoost,LightGBM,CatBoost | .xgb, .bst, .obj,.lgb, .txt, .cbm | xgb Booster.load_model,lgb Booster._init__,CatBoost.load_model | predict, predict_proba† |
| Scikit-learn | .joblib* | joblib.load | predict, predict_proba,transform, decision_function |
| JAX / Flax | .msgpack | flax serialization.msgpack_restore,from_bytes, from_state_dict | __call__, apply |
| CoreML | .mlmodel, .mlpackage | ct.models.MLModel._init__ | predict |
| PaddlePaddle | .pdmodel, .pdiparams | paddle.jit.load, paddle.load | __call__, forward, predict |
| MXNet | .params, symbol.json | mx.nd.load, mx.sym.load | predict, forward |
| TensorRT | .engine, .plan, .trt | runtime.deserialize_cuda_engine | create_execution_context,execute, execute_v2,execute_async_v2§ |
| PMML | .pmmll | PMMLModel.fromFile | predict |
| NumPy | .npy, .npz | np.load | load-time only‡ |
| Pickle | .pkl, .pickle | pickle.load, pickle.loads | (implicit execution on load) |
| Dill | .dill | dill.load, dill.loads,dill.load_module, dill.load_session | (implicit execution on load) |
†predict_proba is available on sklearn-style wrappers (e.g., XGBClassifier, LGBMClassifier), not on the raw Booster API. Both are instrumented when present.
*Scikit-learn objects serialized as .pkl or .pickle are handled through the generic Pickle.
§TensorRT execution methods are instrumented when an execution context is created; the default inspection path deserializes the engine only.
‡Pickle-backed execution occurs only when allow_pickle=True and the file contains object arrays.
store to inherit the parent's correlation context, then a thread-local correlation table maintained at the application level, and finally the correlation context of the model currently under analysis. This ordered fallback ensures that events remain attributed even when context propagation has not yet completed, for example, when a child process emits syscalls before the clone exit probe has propagated the parent's context. Each resolved event is then assigned to the loading-phase or inference-phase stream based on its phase tag.
5.5. Attack Behavior Classification
The attributed event streams are then classified against a taxonomy of attack behaviors, addressing challenge C4.
Pattern Representation. Attack behaviors are defined as patterns of ordered steps, where each step specifies a sub-operation (e.g., File.open, Network.connect) that must be observed in the event stream. A step may also constrain the target path or flags, such as open modes and socket families, and can be marked as optional. Individual operations that may indicate malicious intent, such as ac-
cessing a sensitive file, are not flagged unless a subsequent step produces an observable impact, such as network transmission or code execution. Without such follow-up, flagging the operation would produce false positives on framework activity that incidentally accesses sensitive paths.
Pattern Matching. The classifier processes each phase-specific event stream in a single linear pass. For each pattern, it maintains a pointer to the current step and advances it when a matching event is observed. Multiple patterns are evaluated simultaneously, each with its own pointer, enabling matching in for events and patterns.
Cross-Event Linking. Event ordering alone is insufficient to prevent unrelated events from matching a pattern. For instance, a model may read /etc/hosts for DNS resolution and separately open a network connection to download weights; without additional constraints, these unrelated events could falsely match an exfiltration pattern. To address this, multi-step patterns that span distinct system resources include correlation constraints that require matched events to share a common identifier, such as a file path, file descriptor, or byte count. Path correlation links file events through
TABLE 2. ATTACK BEHAVIOR TAXONOMY AND CORRESPONDING MITRE ATT&CK MAPPINGS.
| ID | Behavior Class | # | Description | MITRE ATT&CK |
|---|---|---|---|---|
| AB1 | Sensitive Information Theft | 83 | Reading sensitive files or discovering host, network, and process state, then exfiltrating the collected data over TCP or UDP. | T1003, T1005, T1016, T1025, T1033, T1039, T1041, T1048, T1049, T1056, T1057, T1059, T1082, T1083, T1550, T1552, T1555, T1560 |
| AB2 | Backdoor / Persistence | 21 | Modifying system configuration files or replacing binaries to maintain access across reboots or user sessions. | T1037, T1053, T1098, T1136, T1542, T1543, T1546, T1547, T1548, T1556, T1574 |
| AB3 | System Manipulation | 34 | Deleting, modifying, or tampering with system files, logs, permissions, network settings, or security controls. | T1036, T1059, T1070, T1098, T1222, T1485, T1548, T1556, T1562, T1565 |
| AB4 | Malicious Code Execution | 15 | Spawning processes, staging and executing scripts, or injecting code outside normal model operations. | T1055, T1059, T1083, T1105, T1106, T1204, T1565, T1567, T1620 |
| AB5 | Cryptojacking | 7 | Running or deploying cryptocurrency miners, optionally with resource profiling and mining pool communication. | T1059, T1082, T1105, T1496, T1620 |
| AB6 | Remote Control | 16 | Establishing remote access through reverse shells, bind shells, remote command execution, lateral movement, or proxy tunneling. | T1021, T1036, T1059, T1071, T1090, T1095, T1204 |
| AB7 | Ransomware | 8 | Encrypting user files, exfiltrating encryption keys, and inhibiting system recovery. | T1041, T1083, T1135, T1486, T1490, T1491 |
| AB8 | Privilege Escalation | 11 | Elevating process privileges through UID/GID manipulation, SUID abuse, capability changes, kernel module loading, or namespace escape. | T1068, T1547, T1548, T1611 |
a shared path. When an event matching a File.open step captures the file path, subsequent File.read or File.write steps advance only if the candidate event operates on the same path. Socket correlation links network events through a shared socket descriptor. When an event matching a Network.connect step captures the descriptor, subsequent Network.send steps advance only if the candidate event uses the same descriptor. Data volume correlation links file reads to network sends by comparing actual byte counts. MODELSHIELD captures syscall arguments at entry and emits the event at exit, using the return value as the actual bytes transferred. When a File.read event is matched, its byte count is recorded. A subsequent Network.send step advances only if its byte count falls within a plausible range of the recorded value, considering encoding overhead (e.g., Base64 at 1.33×, hex at 2×) and protocol overhead (e.g., JSON or HTTP wrapping).
Loop Detection. Some attack behaviors produce repetitive syscall cycles that fixed-length patterns cannot capture. MODELSHIELD detects such behavior by tracking repeated operation sequences within the event stream. For instance, it tracks file-operation cycles (File.open → File.read →File.write) across distinct files for ransomware, and sustained send-receive exchanges (Network.send → Network.recv) for mining activity.
Attack Taxonomy. MODELSHIELD defines eight attack behavior classes (AB1–AB8), summarized in Table 2 with their descriptions and corresponding MITRE ATT&CK techniques. Each class contains multiple patterns covering common variants. For instance, AB1 includes 83 patterns spanning TCP and UDP exfiltration of sensitive information (e.g., SSH keys, cloud tokens, browser stores, cryptocurrency wallets, and system configuration), as well as keylogging and command-based discovery. AB4 covers shell and interpreter spawning, script staging and execution, and suspicious subprocess creation. AB6 covers reverse shells, bind shells, remote command execution, lateral movement, and outbound command-and-control connections. Each pattern is an ordered sequence of sub-operations with argument constraints enforced through the correlation mechanism. To illustrate, the TCP credential-exfiltration pattern in AB1 matches when openat targets a credential file such as ~/ssh/id_rsa in read-only mode, followed by read on the same file descriptor, then connect to an external IP address, and finally sendto on the same socket descriptor. The reverse-shell pattern in AB6 matches when socket creates a TCP endpoint, connect reaches an external host, three dup2 calls redirect standard input, output, and error to the connected socket, and execve launches a shell interpreter such as /bin/bash. This taxonomy is derived from reported malicious models and documented attack techniques, and is extended through the LLM-based discovery stage described below. Representative sequences for all eight classes are provided in Table 10 in the appendix.
LLM-Based Behavior Discovery. The pattern taxonomy is bounded by the behaviors defined at design time. To identify attack behaviors not yet covered, MODELSHIELD includes an offline LLM-based discovery stage applied to models labeled as benign by the classifier. For each model, the loading-phase and execution-phase syscall traces are submitted to an LLM along with a description of expected benign ML runtime behavior and the existing AB1–AB8 category definitions. The LLM is instructed to identify any syscall activity that deviates from the benign baseline and is not covered by the eight attack classes. For each flagged model, the LLM returns a verdict (BENIGN, SUSPICIOUS, or MALICIOUS), confidence level, the relevant syscall subsequence, and MITRE ATT&CK mappings. Flagged models are then manually reviewed to confirm whether the reported behavior reflects a genuine attack. Confirmed behaviors are added to the taxonomy as new patterns.
6. Evaluation
We evaluate MODELSHIELD through the following research questions:
- RQ1. What is the detection accuracy of MODELSHIELD compared to existing scanners?
- RQ2. Can MODELSHIELD detect evasion techniques that bypass existing scanners?
- RQ3. Can MODELSHIELD detect malicious models hosted on public platforms that existing scanners fail to detect?
- RQ4. How efficient is MODELSHIELD compared to existing scanners at large scale?
Experimental Setup. We ran all experiments on three virtual machines hosted on a workstation with an Intel Core i9-13900K processor. Each VM had 4 vCPUs, 16 GB RAM, and ran Ubuntu 20.04 LTS with Linux kernel 5.15, one dedicated to each public platform scan. The application-level instrumentation used dynamic AOP weaving, while the kernel-level monitoring layer was built on the BPF Compiler Collection (BCC). For static scanner comparison, we ran ModelScan [13] (v0.8.8), PickleScan [11] (v1.0.4), Fickling [35] (v0.1.11), and ModelAudit [36] (v0.2.45). For the LLM-based pattern discovery, we used GPT-5.5. Since building a separate environment per model is infeasible due to time and storage overhead and many models lack dependency declarations, we maintained a pool of five pre-built Python 3.9 virtual environments (see Table 11 in the appendix), each pinned to a major framework version. The pool covers 99.8% of the scanned models, distributed as PyTorch (93.0%), ONNX (3.1%), classical ML (2.9%), and TensorFlow/Keras (0.8%). We excluded the remaining 0.2% (JAX/Flax, CoreML, PaddlePaddle, MXNet, TensorRT) due to limited prevalence and minimal documented attack activity. For each model, we selected the environment based on platform metadata and file format (see Section 5.1).
Evaluation Datasets. For detection accuracy (RQ1), we adopted the evaluation dataset published with PickleBall [17], [37], which contains 252 benign and 84 malicious models. For evasion robustness (RQ2), we selected 15 gadget substitutions covering denylisted primitives, standard-library wrappers, and ML-library gadgets from Liu et al. [14], along with 10 loading-path obfuscation cases spanning raw pickle, five Joblib compression variants, PyTorch ZIP and TAR containers, NumPy pickle-backed loading, and one EOP bypass. All samples embed an SSH private-key access payload to produce observable credential-access behavior at runtime. We also included all four TensorFlow SavedModel API abuse attacks from Zhu et al. [15], [38], targeting IP exposure, file leakage, code execution, and shell access. For large-scale detection and efficiency (RQ3, RQ4), we scanned models uploaded between March 25 and May 5, 2026, on Hugging Face, ModelScope, and Kaggle, yielding 105,000, 30,000, and 10,000 models, respectively. We allocated the largest scanning volume to Hugging Face as it is the most widely adopted platform and the most frequently targeted by both attackers and security researchers.
6.1. Detection Accuracy Results
MODELSHIELD produces zero false positives across all 252 benign files of the PickleBall evaluation dataset. On the 84 malicious files, it reports 47 true positives and 37 false negatives. Table 3 categorizes these false negatives by cause: 1 is a ground-truth mislabel containing no injected payload (oceanhacktitude/tinymodel/twitter-roberta-base-sentiment.bin); 9 arise from environment limitations (5 require packages absent from the runtime environment, all detected after installation, and 4 target Windows-specific APIs); 4 fail before producing any behavior due to syntax errors, undefined variables, or missing target files. The remaining 23 execute successfully but produce no malicious runtime behavior (e.g., printing to standard output or writing to non-sensitive paths). Although all 37 are end-to-end system misses, none represents a classification failure in which MODELSHIELD observed a malicious syscall pattern and failed to flag it.
TABLE 3. CATEGORIZATION OF THE 37 FALSE NEGATIVES ON THE PICKLEBALL EVALUATION DATASET.
| Category | # | Description |
|---|---|---|
| Ground-truth mislabeling (1) | ||
| Mislabeled sample | 1 | Contains no malicious payload |
| Environment limitation (9) | ||
| Missing dependencies | 5 | Requires packages (i.e., mlflow, requests, Pillow, cloudpickle, IPython, pydevd) absent from the environment † |
| Windows-only payload | 4 | Calls nt.system or Calc.exe |
| Incomplete execution (4) | ||
| Defective payload (syntax) | 1 | Places return inside eval (), raising SyntaxError |
| Defective payload (runtime) | 1 | Calls print (hello) with an undefined variable, raising NameError |
| Missing target file | 2 | References a file not included in the model artifact (bad_dataloader.py, exec_test.py) |
| No malicious runtime behavior (23) | ||
| Print-only payload | 16 | Produces only write (stdout) syscalls |
| Write to non-sensitive paths | 4 | Writes files (e.g., p0wn3d.txt, test.txt, and YOUAREHACKED.txt) using relative paths, and writes /tmp/1 under /tmp |
| Bytecode compilation | 1 | Calls compile () to produce bytecode but never passes it to exec() |
| Debugger invocation | 1 | Calls pdb.set_trace(), blocking on interactive input |
| Benign imports | 1 | Imports_io.BytesIO and numpy.load to reconstruct an array from in-memory bytes |
†After installing the required packages and re-executing the five models, MODELSHIELD detected all of them, yielding 52 TP and 32 FN.
Table 4 compares MODELSHIELD against existing scanners on the PickleBall evaluation dataset. PickleBall [17] analyzes library class definitions to generate per-library allowlists of permitted callables, blocking all 84 malicious models whose payloads call callables outside these allowlists. However, it rejects 51 benign models due to namespace mismatches, out-of-class attributes, legacy callables, and secondary pickle loads triggered during inference. ModelScan misses 9 malicious files due to denylist gaps, runtime-only payloads, and multi-STOP-opcode payloads that terminate parsing early. It produces 16 false positives by denylisting getattr, which benign models routinely use. PickleScan misses 5 files due to callables outside its dangerous-imports list, indirect imports through allowed modules, and payloads hidden inside nested pickles, with the same 16 false positives. Fickling fails to parse PyTorch archive formats and crashes on unsupported opcodes, detecting only 2 malicious files while flagging all 252 benign files. ModelAudit misses 2 files, of which one uses a third-party wrapper absent from its denylist. It produces 91 false positives by matching benign weight dictionaries against a CVE-2026-24747 pattern, flagging version-based vulnerabilities, and misreading TorchScript parameter names as dangerous builtins. DynaHug [19] flags all 336 files as malicious, as its one-class SVM classifier is trained on syscall profiles from text-generation models. As a result, it flags models from different tasks and libraries as outliers. One file missed by all scanners is the mislabeled RoBERTa model discussed in Table 3. PickleBall also blocks this file, as none of its library policies cover the transformers library. Since excluding it would not change the relative ordering of the tools, we report all results against all 84 malicious models.
TABLE 4. COMPARISON OF STATIC AND DYNAMIC TOOLS ON THE PICKLEBALL EVALUATION DATASET.
| Tool | TP | TN | FP | FN | Prec. | Recall | F1 |
|---|---|---|---|---|---|---|---|
| Static Approaches | |||||||
| PickleBall | 84 | 201 | 51 | 0 | 62.22% | 100.00% | 76.71% |
| ModelScan | 75 | 236 | 16 | 9 | 82.42% | 89.29% | 85.71% |
| PickleScan | 79 | 236 | 16 | 5 | 83.16% | 94.05% | 88.27% |
| Fickling | 2 | 0 | 252 | 82 | 0.79% | 2.38% | 1.18% |
| ModelAudit | 82 | 161 | 91 | 2 | 47.40% | 97.62% | 63.81% |
| Dynamic Approaches | |||||||
| DynaHug | 84 | 0 | 252 | 0 | 25.00% | 100.00% | 40.00% |
| MODELSHIELD | 47 | 252 | 0 | 37 | 100.00% | 55.95% | 71.76% |
Answer to RQ1
MODELSHIELD is the only evaluated tool with zero false positives on the PickleBall evaluation dataset. Its 37 false negatives arise from payloads that either fail to execute due to environment limitations or produce no malicious runtime behavior; none from classification errors.
6.2. Evasion Techniques Detection Results
Table 5 compares the static scanners and MODELSHIELD against evasion techniques. ModelScan and PickleScan, limited to their denylists, cover only a narrow
TABLE 5. DETECTION RESULTS OF STATIC SCANNERS AND MODELSHIELD AGAINST 29 EVASION VARIANTS.
| Evasion Variant | Lib | MS | PS | Fi | MA | MS |
|---|---|---|---|---|---|---|
| Gadget Substitution [14] | ||||||
| os.system | stdlib | ✓ | ✓ | ✓ | ✓ | ✓ |
| pydoc.pipepager | stdlib | ✗ | ✓ | ✓ | ✓ | ✓ |
| pydoc.tempfilepager | stdlib | ✗ | ✓ | ✓ | ✓ | ✓ |
| doctest.debug_script | stdlib | ✗ | ✓ | ✓ | ✓ | ✓ |
| eval | builtin | ✓ | ✓ | ✓ | ✓ | ✓ |
| exec | builtin | ✓ | ✓ | ✓ | ✓ | ✓ |
| np.distutils. | NumPy | ✗ | ✗ | ✓ | ✓ | ✓ |
| exec_command | ||||||
| np.distutils. | NumPy | ✗ | ✗ | ✓ | ✗ | ✓ |
| cpinfo.getoutput | ||||||
| np.core. | NumPy | ✓ | ✓ | ✓ | ✓ | ✓ |
| _ufunc_reconstruct | ||||||
| sympy.printing. | SymPy | ✗ | ✗ | ✓ | ✓ | ✓ |
| tests.test_repr.st | ||||||
| sympy.sympify | SymPy | ✗ | ✗ | ✓ | ✓ | ✓ |
| pandas._version. | Pandas | ✓ | ✓ | ✓ | ✓ | ✓ |
| run_command | ||||||
| cProfile.run | stdlib | ✗ | ✓ | ✓ | ✓ | ✓ |
| exec+_import__ | builtin | ✓ | ✓ | ✓ | ✓ | ✓ |
| subprocess. | stdlib | ✓ | ✓ | ✓ | ✓ | ✓ |
| check_output | ||||||
| Gadget Detection | 7 | 11 | 15 | 14 | 15 | |
| Loading Path Obfuscation [14] | ||||||
| Joblib raw pkl | - | ✓ | ✓ | ✓ | ✓ | ✓ |
| Joblib gzip→pkl | - | ✗ | ✗ | ✗ | ✗ | ✓ |
| Joblib bz2→pkl | - | ✗ | ✗ | ✗ | ✗ | ✓ |
| Joblib xz→pkl | - | ✗ | ✗ | ✗ | ✗ | ✓ |
| Joblib lzma→pkl | - | ✗ | ✗ | ✗ | ✗ | ✓ |
| Joblib zlib→pkl | - | ✗ | ✗ | ✗ | ✗ | ✓ |
| PyTorch zip→pkl | - | ✗ | ✓ | ✗ | ✓ | ✓ |
| PyTorch tar→pkl | - | ✗ | ✗ | ✗ | ✓ | ✓ |
| NumPy npy (pickle) | - | ✓ | - | ✓ | ✓ | ✓ |
| EOP-1 STACK_GLOBAL | - | ✗ | ✓ | ✓ | ✓ | ✓ |
| Path Detection | 2 | 3 | 3 | 5 | 10 | |
| TensorFlow API Abuse [15] | ||||||
| IP Exposure | - | - | - | - | - | ✓ |
| File Leak | - | - | - | - | - | ✓ |
| Code Execution | - | - | - | - | - | ✓ |
| Shell Access | - | - | - | - | - | ✓ |
| TF Detection | - | - | - | - | 4 | |
MS = ModelScan, PS = PickleScan, Fi = Fickling, MA = ModelAudit, MS = MODELSHIELD.
set of gadget substitutions and loading paths. Fickling detects all gadget substitutions but cannot parse compressed Joblib or PyTorch container formats. ModelAudit detects 14 of 15 gadget substitutions (hanging on numpy.distutils.cpuinfo.getoutput) but fails on all compressed Joblib variants. For TensorFlow API abuse, PickleScan and Fickling do not support the SavedModel format. ModelScan flags File Leak and Shell Access due to RpcClient/RpcCall operations in their graphs, while ModelAudit flags checkpoint operations (RestoreV2, SaveV2, MergeV2Checkpoints) across all four attacks. However, both produce identical findings on benign models containing the same operations; accordingly, their detections are not counted in the table. MODELSHIELD detects all 29 variants, as these techniques modify the delivery mechanism without altering syscall-level behavior. Detailed evidence is provided in Table 12 in the appendix.
Answer to RQ2
MODELSHIELD detected all 29 evasion variants across gadget substitution, loading-path obfuscation, and TensorFlow API abuse, where no static scanner achieved complete coverage.
6.3. Large-Scale Detection Results
MODELSHIELD detected 41 confirmed malicious models during the Hugging Face scan, including two real-world malware samples (Sections 6.3.1 and 6.3.2). However, no malicious models were identified on ModelScope or Kaggle within the evaluated time window. The full set is in Table 13 in the appendix. Table 6 summarizes the 41 models by format, attack behavior, and execution phase. Pickle is the most targeted format, followed by PyTorch and Joblib. AB4 is the most common behavior, appearing in 30 models, while AB6 appears in 14, covering outbound connections through standard-library clients, reverse shells, and TLS-based channels. Among pickle-based formats, some payloads execute during deserialization, while others return callable objects whose invocation triggers the malicious behavior. Note that models may exhibit multiple behavior classes, so columns sum to more than 41.
TABLE 6. DISTRIBUTION OF THE 41 MALICIOUS MODELS BY FORMAT, ATTACK BEHAVIOR, AND DETECTION PHASE.
| Format | # | AB1 | AB3 | AB4 | AB6 | AB8 | L/E |
|---|---|---|---|---|---|---|---|
| Pickle | 19 | - | 4 | 9 | 7 | - | 12/7 |
| PyTorch | 9 | 1 | - | 9 | 4 | 1 | 5/4 |
| Joblib | 7 | - | - | 6 | 2 | - | 4/3 |
| NumPy | 4 | - | - | 4 | 1 | - | 1/3 |
| Dill | 1 | - | - | 1 | - | - | 0/1 |
| Scikit-learn | 1 | - | - | 1 | - | - | 0/1 |
| Total | 41 | 1 | 4 | 30 | 14 | 1 | 22/19 |
AB indicates Attack Behavior, and L/E indicates Loading vs. Execution.
Table 7 compares the static scanners against MODELSHIELD on the 41 malicious models. ModelScan and PickleScan detect only 29% and 56%, respectively, as their denylists omit network-capable and utility callables (e.g., imaplib.IMAP4, smtplib.SMTP, ftplib.FTP, ssl.get_server_certificate, timeit.timeit) and neither parses compressed Joblib, Dill, or legacy TAR formats. Fickling covers all raw pickle streams, detecting 80%, yet it does not support container formats, such as compressed Joblib, ZIP-wrapped PyTorch, and NumPy .npz archives. ModelAudit achieves the highest static detection rate at 93%; however, it hangs indefinitely on three models that reference network-facing modules (e.g., imaplib.IMAP4, nntplib.NNTP).
To assess recall beyond MODELSHIELD's own detections, we ran all static scanners on a 10,000-model subset. The union of their detections yielded 565 positives, of which manual inspection confirmed 8 as malicious. MODELSHIELD detected 5 of the 8. The 3 misses are end-to-end system failures: 2 models crash the framework parser before payload execution, and 1 reads a sensitive file without any
TABLE 7. DETECTION RESULTS OF STATIC SCANNERS AND MODELSHIELD AGAINST THE 41 MALICIOUS MODELS.
| Format | # | MS | PS | Fi | MA | MS |
|---|---|---|---|---|---|---|
| Pickle | 19 | 3 | 9 | 19 | 16 | 19 |
| PyTorch | 9 | 2 | 7 | 4 | 9 | 9 |
| Joblib | 7 | 3 | 4 | 5 | 7 | 7 |
| NumPy | 4 | 3 | 2 | 3 | 4 | 4 |
| Dill | 1 | 0 | 0 | 1 | 1 | 1 |
| Scikit-learn | 1 | 1 | 1 | 1 | 1 | 1 |
| Total | 41 | 12 | 23 | 33 | 38 | 41 |
subsequent harmful action. However, none is a classification failure, as no malicious syscall pattern was produced and missed by the classifier. The remaining 557 flags were false positives from denylisted callables used in benign contexts.
We further compare against DynaHug [19], [39] on the same 41 models. We found that torch.load() fails before payload execution on all 32 non-PyTorch files, limiting DynaHug to 9 loadable models. Of those, 4 trigger only during inference, which DynaHug does not monitor, reducing its coverable set to 5 models. Its classifier flags all inputs as anomalous with the same confidence score, including a benign PyTorch model.
6.3.1. Case Study 1 (Live Reverse Shell). MODELSHIELD flagged LQCTestingSpace/lqc_model, uploaded on March 27, 2026, which had 108 downloads over three days without detection by any of the platform's scanners. The repository presented itself as a Qwen2 model requiring ~300 MB of weights, yet its pytorch_model.bin was only 10.2kB. The pickle consisted of a single REDUCE opcode invoking the following command:
import ("os").system( "bash -c 'bash -i &> /dev/tcp /18.138.220.214/11014 0>&'")
The payload was packaged using PyTorch's legacy tar-based loading path, one of the evasion paths shown by Liu et al. [14] to bypass platform scanners. To our knowledge, this is the first documented in-the-wild use of this technique. Figure 2 shows how MODELSHIELD's correlation mechanism tracks the malicious behavior across four processes linked by three clone() boundaries and one execve(). The AOP wrapper tags AutoModel.from_pretrained() with a correlation identifier (bd999e7d) and phase LOADING. When the pickle REDUCE opcode triggers os.system(), the eBPF probe propagates a fresh identifier (a8ecdbfc) to the spawned child, preserving the link to the originating model load. The child then executes /usr/bin/bash (AB4; T1059.004) and connects to 18.138.220.214:11014 (AB6; T1071).
6.3.2. Case Study 2 (Host Reconnaissance and Exfiltration). MODELSHIELD also flagged cgruzicka/test-lora-weights, a repository containing lora_weights.bin and pytorch_lora_weights.bin, mimicking a legitimate
Correlation ID (bd999e7d → 017cca6f → a8ecdbfc): three clone() boundaries and one execve across four processes
| Phase 1 (Loading) [LOADING] | pid=132227 | tid=132227 | comm=python3.9 | Correlation ID=bd999e7d |
|---|---|---|---|---|
| openat | $MODEL_DIR/pytorch_model.bin | flags=0_CLOEXEC | ||
| read | $MODEL_DIR/pytorch_model.bin | file descriptor size (Model) = 4096 | ||
| stat | /tmp/&tmpdir> | |||
| openat | /tmp/&tmpdir>/ storages | 0_WRONLY|0_CREAT|0_TRUNC | ||
| write | /tmp/&tmpdir>/ storages | file descriptor size (TAR) = 121 | TAR extracted | |
| openat | /etc/nsswitch.conf, /etc/passwd, /etc/group | flags=0_CLOEXEC | Libc user Lookup | |
| Read x6 | /etc/nsswitch.conf, /etc/passwd, /etc/group | flags=0_CLOEXEC | ||
| openat | /tmp/&tmpdir>/ storages | flags=0_CLOEXEC | Correlation ID → 017cca6f | |
| read | /tmp/&tmpdir>/ storages | file descriptor size (Pickle) = 1, 1, 1, 8, 110 | pickle REDUCE opcode in final 110-byte read | |
| clone | flags=0x4111 (CLONE_VM|CLONE_VFORK|SIGCHLD) | |||
| ↓ clone boundary (correlation becomes a8ecdbfc) | os.system() forks | |||
| Phase 2 (Process chain) [EXECUTION] | pid=132228 | tid=132228 | comm=sh | (new process) Correlation ID= a8ecdbfc |
| access | /etc/ld.so.preload | flags=R_OK|W_OK|X_OK | ||
| openat | /etc/ld.so.cache, libc.so.6 | flags=0_CLOEXEC | ||
| clone | flags=CLONE_SYSVSEM|CLONE_CHILD_CLEARID | |||
| ↓ clone boundary (correlation propagates) | ||||
| Phase 2 cont. (Shell spawn) [EXECUTION] | pid=132229 | tid=132229 | comm=sh>bash | (new process, then execve) |
| execve | /usr/bin/bash | AB4 match (shell) | ||
| sysinfo, uname, getpeername | flags=CLONE_SYSVSEM|CLONE_CHILD_CLEARID | |||
| clone | ||||
| ↓ clone boundary (correlation propagates) | ||||
| Phase 3 (C2 callback) [EXECUTION] | pid=132230 | tid=132230 | comm=bash | (new process) Correlation ID= a8ecdbfc |
| socket | AF_INET/SOCK_STREAM/TCP | family=AF_INET | ||
| connect | 18.138.220.214:11014 | AB6 match (reverse shell) | ||
| Write x2 | Stderr (localized error) | write size = 34,56 | ||
Figure 2. Syscall Trace of the Real-World Reverse-Shell Payload Captured by MODELSHIELD.
LoRA fine-tuning artifact. During deserialization, the model spawned /bin/sh, executed reconnaissance commands (id, whoami, hostname, cat /proc/version), read /etc/passwd and /proc/version, collected environment variables, and exfiltrated the gathered data over outbound HTTPS connections (port 443) to two IPv4 endpoints (178.63.67.153, 178.63.67.106) and two IPv6 endpoints (2a01:4f8:121:114d::2, 2a01:4f8:121:11a5::2). MODELSHIELD classified this behavior under AB1 (sensitive information theft with exfiltration; T1003.008, T1041), AB4 (shell spawning and reconnaissance; T1059.004, T1082, T1033), and AB6 (outbound connections to attacker-controlled endpoints; T1071).
Answer to RQ3
MODELSHIELD detected 41 malicious models on Hugging Face, including models that no evaluated static or dynamic scanner detected.
6.4. Scalability Results
Table 8 presents per-model analysis time across all evaluated tools. MODELSHIELD achieves a median analysis time of 12.34 seconds, comprising inspector and classifier phases; download time is excluded as it depends on platform infrastructure. Each model file is limited to 5 GB and a 300-second inspector timeout. Static scanners are significantly faster, as they analyze model artifacts without loading or executing them. Fickling is the fastest, as it parses
TABLE 8. PER-MODEL TIMING DISTRIBUTION ACROSS EVALUATED TOOLS.
| Tool | Mean (s) | Median (s) | P90 (s) | Max (s) |
|---|---|---|---|---|
| ModelShield | ||||
| Inspector | 17.55 | 12.17 | 34.94 | 298.63 |
| Classifier | 0.25 | 0.16 | 0.50 | 5.93 |
| Total | 17.79 | 12.34 | 35.47 | 298.86 |
| Other Evaluated Scanners | ||||
| ModelScan | 3.44 | 2.33 | 4.46 | 120.02 |
| PickleScan | 3.26 | 0.07 | 4.08 | 122.65 |
| Fickling | 0.21 | 0.06 | 0.08 | 30.03 |
| ModelAudit | 5.60 | 2.45 | 11.05 | 119.32 |
| DynaHug | 9.55 | 3.54 | 19.98 | 126.24 |

Figure 3. CDF of Per-Model Analysis Time.
pickle bytecode, followed by PickleScan, ModelScan, and ModelAudit. DynaHug achieves a median of 3.54 seconds, as it monitors only the loading phase of PyTorch models. MODELSHIELD introduces additional overhead, at approximately over ModelScan and ModelAudit and over DynaHug. This reflects the cost of loading and executing each model while tracing and attributing its syscalls across both phases. Figure 3 shows the cumulative distribution function (CDF), where a point indicates that of models completed within x seconds. For instance, Fickling scans 90% of models within 0.08 seconds and ModelScan within 4.46 seconds, while MODELSHIELD requires 35.47 seconds. At this rate, a single MODELSHIELD instance can process approximately 4,856 models per day.
Answer to RQ4
MODELSHIELD introduces additional overhead compared to the evaluated tools due to its runtime analysis requirements. Despite this, it achieves a median analysis time of 12.3 s with 90% of scans complete within 35.5 s, making it practical for platform-scale scanning.
6.5. LLM-Assisted Discovery Results
We used GPT-5.5 to analyze 10,000 Hugging Face models confirmed as benign by the classifier, covering all major formats. GPT-5.5 flagged mathiasthemaster/tabular-playground, which executes /usr/bin/touch via a posix.system payload embedded in a pickle reduce gadget. After manual confirmation, we added a corresponding pattern to AB4, increasing the taxonomy to 195 patterns. It also produced false positives. For instance, it flagged Ievan/attn_optuna_06_04 as malicious with high confidence, interpreting a double sys.path stat walk during _pickle.load as evidence of embedded import () calls.
7. Discussion
False Positive and False Negative Analysis. As shown in Section 6.1, MODELSHIELD produces zero false positives, while its false negatives are limited to payloads that do not produce observable malicious behavior (see Table 3). Static scanners reduce these false negatives by detecting payloads at the artifact level, but at the cost of high false-positive rates. Accordingly, the two approaches are complementary, and deploying both is necessary for robust detection.
Limitations. As a dynamic analysis system, MODELSHIELD observes only the execution paths reached during analysis. Payloads that depend on specific inputs, environmental conditions, or delayed timers may not activate. Similarly, malformed artifacts that exploit native parser vulnerabilities may crash without producing observable syscall sequences. Malicious payloads may also require specific packages or external files that no runtime analysis system can anticipate; such payloads fail silently without execution. Moreover, the runtime environment targets Linux; thus, payloads targeting other operating systems remain undetected.
Extended Detection Results. Beyond the evaluation period, we continued deploying MODELSHIELD on Hugging Face through August 19, 2026, scanning 224,164 models and detecting 105 additional malicious models, including two real-world malware samples. The first, antarge/minilm-finetuned, is disguised as a MiniLM variant and spawns shell interpreters during deserialization; MODELSHIELD detected it within one hour of upload, with 126 downloads at detection time. The second, afdafdfs/daaaadssf, is disguised as a Llama model, harvests credentials from /root/.bash_history, performs host reconnaissance, and opens a reverse shell to 78.17.93.96:9000. MODELSHIELD detected this model three hours after upload, and Hugging Face disabled access following our disclosure.
8. Conclusion
We presented MODELSHIELD, the first runtime behavioral detection system that attributes observed syscall activity to specific model operations. By combining application-level instrumentation with eBPF-based syscall tracing, MODELSHIELD propagates correlation context across threads and child processes, separating model-triggered behavior from framework and environment noise. It then classifies the attributed syscall sequences against 195 detection patterns mapped to MITRE ATT&CK techniques. On an independent dataset, MODELSHIELD is the only evaluated tool to achieve zero false positives; false negatives arise from payloads that do not produce observable malicious behavior during analysis, none of which represent classification errors. It also achieved complete detection across the 29 evasion variants that bypass existing static scanners. On 145,000 models across three public platforms, MODELSHIELD detected 41 malicious models on Hugging Face, including two real-world malware samples. Despite higher runtime overhead compared to existing scanners, MODELSHIELD achieves a median analysis time of 12.3 s per model, making it practical for platform-scale screening.
9. Data Availability
The MODELSHIELD source code, detection taxonomy, evaluation test suites, and reproduction scripts are available at https://github.com/HalaAli198/ModelShield. The repository also provides full detection details for all detected malicious models and security advisories for the four discovered real-world malware samples.
10. Ethical Considerations
We reported all real-world malware samples to the Hugging Face Security Team. We also reported the reverse-shell payload to AWS Trust & Safety, as its command-and-control server was hosted on AWS infrastructure; Hugging Face removed the model within two days, and AWS took action on the reported endpoint. All analysis was performed in isolated virtual machines containing no sensitive data.
11. LLM Usage Statement
LLMs were used for editorial purposes in this manuscript, and all outputs were inspected by the authors to ensure accuracy and originality.
References
[1] Hugging Face, Inc., “Hugging Face Hub Documentation,” https://huggingface.co/docs/hub/index, 2026, accessed: 2026-04-14.
[2] Kaggle, Inc., “Kaggle Models,” https://www.kaggle.com/models, 2026, accessed: 2026-04-14.
[3] Alibaba DAMO Academy, “ModelScope,” https://modelscope.cn, 2026, accessed: 2026-04-14.
[4] Google Research, Brain Team, “TensorFlow Hub: Reusable Machine Learning Modules,” https://www.tensorflow.org/hub, 2026, accessed: 2026-04-14.
[5] M. Watson, F. Chollet, D. Sreepathihalli, S. Saadat, R. Sampath, G. Rasskin, S. Zhu, V. Singh, L. Wood, Z. Tan, I. Stenbit, C. Qian, J. Bischof et al., “KerasHub,” https://github.com/keras-team/keras-hub, 2024.
[6] D. Hitaj, G. Pagnotta, F. De Gaspari, S. Ruko, B. Hitaj, L. V. Mancini, and F. Perez-Cruz, “Do you trust your model? Emerging malware threats in the deep learning ecosystem,” IEEE Transactions on Dependable and Secure Computing, 2025.
[7] W. Jiang, N. Synovic, M. Hyatt, T. R. Schorlemmer, R. Sethi, Y.-H. Lu, G. K. Thiruvathukal, and J. C. Davis, “An empirical study of pre-trained model reuse in the Hugging Face deep learning model registry,” in Proceedings of the 2023 IEEE/ACM 45th International Conference on Software Engineering (ICSE), 2023, pp. 2463–2475.
[8] J. C. Davis, P. Jajal, W. Jiang, T. R. Schorlemmer, N. Synovic, and G. K. Thiruvathukal, “Reusing deep learning models: Challenges and directions in software engineering,” in Proceedings of the 2023 IEEE John Vincent Atanasoff International Symposium on Modern Computing (JVA), 2023, pp. 17–30.
[9] I. Hepworth, K. Olive, K. Dasgupta, M. Le, M. Lodato, M. Maruseac, S. Meiklejohn, S. Chaudhuri, and T. Minkus, “Securing the AI software supply chain,” Google, Tech. Rep., 2024.
[10] B. Casey, J. Santos, and M. Mirakhorli, “A large-scale exploit instrumentation study of AI/ML supply chain attacks in Hugging Face models,” arXiv preprint arXiv:2410.04490, 2024.
[11] M. Maitre, “picklescan,” 2025, accessed: 2026-03-31. [Online]. Available: https://github.com/mmaitre314/picklescan
[12] Hugging Face, “Pickle scanning,” 2024, accessed: 2026-03-31. [Online]. Available: https://huggingface.co/docs/hub/security-pickle
[13] ProtectAI, “modelscan,” 2025, accessed: 2026-03-31. [Online]. Available: https://github.com/protectai/modelscan
[14] T. Liu, G. Meng, P. Zhou, Z. Deng, S. Yao, and K. Chen, “The art of hide and seek: Making Pickle-Based model supply chain poisoning stealthy again,” in Proceedings of the 35th USENIX Security Symposium (USENIX Security 26), 2026, pp. 161–180.
[15] R. Zhu, G. Chen, W. Shen, X. Xie, and R. Chang, “My model is malware to you: Transforming AI models into malware by abusing TensorFlow APIs,” in Proceedings of the 2025 IEEE Symposium on Security and Privacy (SP), 2025, pp. 486–503.
[16] M. Nabeel and O. Starov, “Deep dive into the abuse of DL APIs to create malicious AI models and how to detect them,” arXiv preprint arXiv:2601.04553, 2026.
[17] A. D. Kellas, N. Christou, W. Jiang, P. Li, L. Simon, Y. David, V. P. Kemerlis, J. C. Davis, and J. Yang, “PickleBall: Secure deserialization of pickle-based machine learning models,” in Proceedings of the 2025 ACM SIGSAC Conference on Computer and Communications Security (CCS), 2025, pp. 3341–3355.
[18] TensorFlow, “Using TensorFlow securely,” https://github.com/tensorflow/tensorflow/security, accessed: 2026-05-10.
[19] S. Nambiar, D. Pradhan, and E. Soremekun, “Malicious ML model detection by learning dynamic behaviors,” arXiv preprint arXiv:2604.19438, 2026.
[20] MITRE Corporation, “MITRE ATT&CK® Knowledge Base,” 2024, accessed: 2026-04-14. [Online]. Available: https://attack.mitre.org/
[21] PyTorch Contributors, “PyTorch serialization documentation,” https://pytorch.org/docs/stable/notes/serialization.html, 2022, accessed: 2026-04-01.
[22] TensorFlow Team, “TensorFlow SavedModel guide,” https://www.tensorflow.org/guide/saved_model, 2024, accessed: 2026-04-01.
[23] Joblib Developers, “Joblib: Persistence,” https://joblib.readthedocs.io/en/latest/persistence.html, 2024, accessed: 2026-04-01.
[24] TensorFlow Team, “Save and load models in Keras,” https://www.tensorflow.org/tutorials/keras/save_and_load, 2024, accessed: 2026-04-01.
[25] ONNX Contributors, “ONNX: Open neural network exchange,” https://onnx.ai/onnx/, 2024, accessed: 2026-04-01.
[26] G. Kiczales, J. Lamping, A. Mendhekar, C. Maeda, C. Lopes, J.-M. Loingtier, and J. Irwin, “Aspect-oriented programming,” in Proceedings of the 11th European Conference on Object-Oriented Programming (ECOOP), 1997, pp. 220–242.
[27] X. Zheng, C. Wei, S. Wang, Y. Zhao, P. Gao, Y. Zhang, K. Wang, and H. Wang, “Towards robust detection of open source software supply chain poisoning attacks in industry environments,” in Proceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering (ASE), 2024, pp. 1990–2001.
[28] M. H. Ligh, A. Case, J. Levy, and A. Walters, The Art of Memory Forensics: Detecting Malware and Threats in Windows, Linux, and Mac Memory. John Wiley & Sons, 2014.
[29] C. Cassagnes, L. Trestioreanu, C. Joly, and R. State, “The rise of eBPF for non-intrusive performance monitoring,” in Proceedings of the 2020 IEEE/IFIP Network Operations and Management Symposium (NOMS), 2020, pp. 1–7.
[30] Cilium, “BPF and XDP reference guide,” accessed: 2026-04-02. [Online]. Available: https://docs.cilium.io/en/stable/reference-guides/bpf/
[31] Y. Ghigoff, J. Ribas, S. Afchain, S. Baubeau, and G. Fournier, “Workload protection with eBPF-based file integrity monitoring,” 2024, accessed: 2026-04-02. [Online]. Available: https://www.datadoghq.com/blog/engineering/workload-protection-ebpf-fim/
[32] Linux man-pages project, “ptrace(2) - Linux manual page,” accessed: 2026-04-02. [Online]. Available: https://man7.org/linux/man-pages/man2/ptrace.2.html
[33] J. Zhao, S. Wang, Y. Zhao, X. Hou, K. Wang, P. Gao, Y. Zhang, C. Wei, and H. Wang, “Models are codes: Towards measuring malicious code poisoning attacks on pre-trained model hubs,” in Proceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering (ASE), 2024, pp. 2087–2098.
[34] I. Ravia, “Smashing model scanners: Advanced bypass techniques and a novel detection approach,” Black Hat USA 2025, 2025, accessed: 2026-03-31. [Online]. Available: https://blackhat.com/us-25/briefings/schedule/
[35] Trail of Bits, “Fickling: A Python pickle decompiler and static analyzer,” https://github.com/trailofbits/fickling, 2021, accessed: 2026-04-12.
[36] Booz Allen Hamilton, “ModelAudit,” https://github.com/bah-insignia/modelaudit, 2025, accessed: 2026-03-31.
[37] A. D. Kellas, N. Christou, W. Jiang, P. Li, L. Simon, Y. David, V. P. Kemerlis, J. C. Davis, and J. Yang, “PickleBall: Secure deserialization of pickle-based machine learning models – artifact,” 2025, accessed: 2026-08-19. [Online]. Available: https://doi.org/10.5281/zenodo.16974644
[38] R. Zhu, G. Chen, W. Shen, X. Xie, and R. Chang, "TensorAbuse: Practical attacks," https://github.com/ZJU-SEC/TensorAbuse, 2025, accessed: 2026-05-24.
[39] S. Nambiar, D. Pradhan, and E. Soremekun, "DynaHug: Source code and artifacts," https://github.com/DynaHug-Detector/DynaHug, 2026, accessed: 2026-05-25.
Appendix A. Supplementary Tables
Table 9 lists all syscalls monitored by the eBPF layer, grouped by category. Table 10 shows one representative ordered syscall sequence per sub-behavior for each attack class. Table 11 details the composition of the runtime environment pool. Table 12 details the runtime evidence captured for each TensorAbuse attack variant. Table 13 lists all 41 confirmed malicious models detected on Hugging Face.
TABLE 9. TRACED SYSCALLS GROUPED BY CATEGORY.
| Category | Syscalls |
|---|---|
| System | uname, sysinfo, sched_getaffinity, ioctl, getrandom, sethostname, setdomainname |
| File | open, openat, creat, close, read, pread, pread64, readv, write, pwrite, pwrite64, writev, stat, fstat, newfstatat, statx, access, faccessat, getdents64, getcwd, rename, renameat, renameat2, link, linkat, symlink, symlinkat, unlink, unlinkat, rmdir, chmod, fchmod, fchmodat, chown, fchown, fchownat, lchown, mkdir, mkdirat, readlink, readlinkat, truncate, ftruncate, fcntl, lseek, chdir, fchdir, sendfile, dup, dup2, dup3, setattr, lsetxattr, fsetxattr, removexattr, lremovexattr, fremovexattr, pipe, pipe2, inotify_init, inotify_init1, inotify_add_watch, inotify_rm_watch |
| Network | socket, bind, listen, accept, accept4, connect, sendto, sendmsg, recvfrom, recvmsg, getsockname, getpeername, getsockopt, setsockopt |
| Process | fork, vfork, clone, clone3, prctl, ptrace, setsid, setsns, unshare |
| Memory | mmap, mprotect, memfd_create |
| Permission | getuid, geteuid, getgid, getegid, getgroups, setuid, setgid, setreuid, setresuid, setregid, setresgid, setgroups, capset |
| Code Execution | execve, execveat |
| Kernel Module | init_module, finit_module, delete_module |
TABLE 10. REPRESENTATIVE SYSCALL SEQUENCES FOR EACH ATTACK CLASS. ARROWS INDICATE TEMPORAL ORDERING; PARENTHESIZED STEPS ARE OPTIONAL.
| ID | Sub-Behavior | Ordered Sequence |
|---|---|---|
| AB1 | Credential exfiltration (TCP) | openat(sensitive file, O_RDONLY) → read → (socket) → connect(remote) → sendto |
| Credential exfiltration (UDP) | openat(sensitive file, O_RDONLY) → read → socket(AF_INET, SOCK_DGRAM) → sendto | |
| System fingerprint + exfiltration | uname/sysinfo → (socket) → connect(remote) → sendto | |
| Network discovery + exfiltration | socket(AF_INET, LINK) → (bind) → sendto(route query) → recvfrom → connect(remote) → sendto | |
| Process enumeration + exfiltration | getdents64(/proc) → openat(/proc/pid/*, O_RDONLY) → read → connect(remote) → sendto | |
| Command-based credential access | execve(cat/grep/head) → openat(credential file) → read | |
| Keylogging + exfiltration | openat(/dev/input/event*, O_RDONLY) → read → connect(remote) → sendto | |
| Credential access during execution | openat(credential file, O_RDONLY) → read | |
| AB2 | Cron job installation | openat(/etc/crontab or cron.d/*, O_WRONLY) → write |
| Systemd service creation | openat(systemd unit path, O_WRONLY) → write → (symlink to target.wants) → (execve(systemctl)) | |
| SSH authorized_keys injection | (mkdir(.ssh)) → openat(authorized_keys, O_WRONLY) → write → (chmod) | |
| Shell profile modification | openat(.bashrc/profile/.zshrc, O_WRONLY) → write | |
| Dynamic linker hijack | openat(/etc/ld.so.preload or ld.so.conf, O_WRONLY) → write | |
| Binary replacement | openat(/usr/bin/* or /usr/lib/*, O_WRONLY) → write → (chmod) | |
| User account creation | openat(/etc/passwd or /etc/shadow, O_WRONLY) → write | |
| Python module shadowing | openat(torch.py or numpy.py, O_WRONLY) → write | |
| AB3 | System/log file deletion | unlink(/var/log/* or /etc/* or /home/*) |
| System file modification | openat(/etc/* or /var/log/*, O_WRONLY) → write | |
| Permission modification | chmod/fchmod(system file) | |
| Symlink attack | unlink(sensitive file) → symlink or link | |
| Firewall manipulation (Netlink) | socket(AF_INET, LINK, NETFILTER) → sendto | |
| Process name masquerading | connect(remote) → prctl(PR_SET_NAME) | |
| Temporary script staging | openat(/tmp/*.sh or *.py, O_WRONLY) → write | |
| Syslog message injection | socket(AF_UNIX, SOCK_DGRAM) → sendto | |
| AB4 | Shell interpreter spawning | execve(/bin/sh or /bin/bash) |
| Script staging and execution | openat(/tmp/script, O_WRONLY) → write → (chmod) → execve | |
| Download, stage, and execute | connect(remote) → recvfrom → openat(O_WRONLY) → write → (chmod) → execve | |
| Fileless execution via memfd_create | memfd_create → write → execve | |
| Process injection via ptrace | ptrace(PTRACE ATTACH) → ptrace(PTRACE_POKETEXT) → ptrace(PTRACE_DETACH) | |
| Suspicious subprocess via pipe+fork | pipe2 → clone → dup2 → execve | |
| AB5 | Miner execution with pool communication | (uname/sysinfo) → execve(miner binary) → connect(mining pool port) → (recvfrom) → sendto |
| Fileless miner execution | memfd_create → write → execve → connect(mining pool port) → (recvfrom) → sendto | |
| Miner deployment and execution | openat(miner path, O_WRONLY) → write → (chmod) → execve(same path) | |
| AB6 | Reverse shell | socket → connect(remote) → dup2(→0) → dup2(→1) → dup2(→2) → execve(shell) |
| Bind shell | socket → bind → listen → accept → dup2 → execve(shell) | |
| Pipe-based shell | pipe2 → clone → dup2 → execve(shell) | |
| Remote command execution | connect(remote) → recvfrom(command) → execve → (sendto(result)) | |
| Proxy/port forwarding | socket → bind → listen → accept → connect(remote) | |
| Lateral movement via SSH | execve(ssh) → connect(remote:22) | |
| AB7 | In-place encryption | key-generation indicator → getdents64(user directory) → openat → read → write → (rename) |
| Copy-and-delete encryption | getdents64 → openat(original, O_RDONLY) → read → openat(.enc, O_WRONLY) → write → unlink(original) | |
| Encryption key exfiltration | key-generation indicator → connect(remote) → sendto | |
| Ransom note creation | openat(README or RANSOM*, O_WRONLY) → write | |
| AB8 | Direct privilege elevation | setuid(0) or setresuid(0,0,0) |
| Execute then elevate | execve(binary) → setuid(0)/setresuid(0,0,0) | |
| Kernel module loading | init_module/finit_module, or execve(insmod/modprobe) | |
| Namespace escape | setns(namespace fd), or execve → unshare/setns |
TABLE 11. COMPOSITION OF THE MODELSHIELD RUNTIME ENVIRONMENT POOL.
| Environment | Installed Packages |
|---|---|
| PyTorch (current) | torch 2.4.0, transformers 4.44.0, tokenizers, sentencepiece, dill, cloudpickle, huggingface_hub, safetensors, numpy |
| PyTorch (legacy) | torch 1.13.1, transformers 4.30.0, dill, cloudpickle, huggingface_hub, safetensors, numpy |
| TensorFlow / Keras | tensorflow 2.17.0, keras 3.5.0, torch (CPU), huggingface_hub, safetensors, numpy |
| Classical ML | scikit-learn 1.5.1, joblib 1.4.2, xgboost 2.1.1, lightgbm 4.5.0, catboost 1.2.7, pandas, sympy, pypmml 1.5.8, py4j, torch (CPU), dill, cloudpickle, huggingface_hub, safetensors, numpy |
| ONNX Runtime | onnxruntime 1.18.1, onnx 1.16.2, torch (CPU), huggingface_hub, safetensors, numpy |
TABLE 12. MODELSHIELD DETECTION RESULTS ON THE FOUR TENSORABUSE ATTACKS [15].
| Attack | AB | Main Behavior | Runtime Evidence | Phase | MITRE |
|---|---|---|---|---|---|
| Code Execution | AB3 | Temporary shell script staging | openat→/tmp/exploit.sh | Execution | T1059.004 |
| Shell Access | AB2 | SSH authorized_keys injection | openat→write→.ssh/authorized_keys.tempstate* | Execution | T1098.004 |
| AB6 | Outbound connection to attacker | socket (AF_INET6)→connect (192.168.29.129:1236) | Execution | T1071 | |
| IP Exposure | AB1 | Hardware information theft and exfiltration | openat (/proc/cpuinfo)→read→connect (192.168.29.129:1236)→sendmsg | Execution | T1082, T1041 |
| AB1 | System fingerprinting and exfiltration | uname→connect (192.168.29.129:1236)→sendmsg | Execution | T1082, T1041 | |
| AB6 | Outbound connection to attacker | socket (AF_INET6)→connect (192.168.29.129:1236) | Execution | T1071 | |
| File Leak | AB1 | Hardware information theft and exfiltration | openat (/proc/cpuinfo)→read→connect (192.168.29.129:1236)→sendmsg | Execution | T1082, T1041 |
| AB1 | System fingerprinting and exfiltration | uname→connect (192.168.29.129:1236)→sendmsg | Execution | T1082, T1041 | |
| AB1 | SSH key theft and exfiltration | openat ($HOME/.ssh/id_rsa)→pread64→connect (192.168.29.129:1236)→sendmsg | Execution | T1552.004, T1041 | |
| AB1 | SSH private-key access | openat ($HOME/.ssh/id_rsa)→pread64 | Execution | T1552.004 | |
| AB6 | Outbound connection to attacker | socket (AF_INET6)→connect (192.168.29.129:1236) | Execution | T1071 |
Note. The endpoint 192.168.29.129 is the local IP address used in our experiment to represent the attacker-controlled server.
TABLE 13. SUMMARY OF 41 CONFIRMED MALICIOUS MODELS DETECTED BY MODELSHIELD ON HUGGING FACE.
| # | Author/Model ID | Format | Age at Detection | # Downloads | Current Status | Detected by HF at Scan Time | Phase | Behavior |
|---|---|---|---|---|---|---|---|---|
| 1 | LQCTestingSpace/lqc_model | PyTorch | 3 d | 108 | R | N | E | AB4, AB6 |
| 2 | mathiasthemaster/tabular-playground | Scikit-learn | 1 d | 0 | R | N | E | AB4 |
| 3 | 5oo6w32cu/test-model | PyTorch | 11 h | 43 | A | N | L | AB4, AB6 |
| 4 | askj00bs/modelscan-test-1 | Joblib | 11 d | 0 | A | Y | L | AB4 |
| 5 | cw-fulmark/mlflow-dspy-bypass-rce | Pickle | 16 d | 0 | R | N | L | AB4 |
| 6 | jkhjklll/security-test-xss | Pickle | 3 d | 0 | A | N | E | AB4 |
| 7 | m-j-contrary/transformers-bypass-poc | PyTorch | 16 d | 23 | A | N | L | AB4 |
| 8 | Deneimaiegw/modelscan-npy-bypass-poc | NumPy (.npy) | 1 d | 0 | A | N | E | AB4 |
| 9 | hacnho/pickle-scanner-bypass-syslog-syslog | Pickle | 1 d | 0 | R | N | L | AB3 |
| 10 | hacnho/pickle-scanner-bypass-compileall-compile-file | Pickle | 1 d | 0 | R | N | L | AB3 |
| 11 | hacnho/pickle-scanner-bypass-imaplib-imap4 | Pickle | 1 d | 0 | R | N | L | AB6 |
| 12 | hacnho/pickle-scanner-bypass-nntplib-nntp | Pickle | 1 d | 0 | R | N | L | AB6 |
| 13 | hacnho/pickle-scanner-bypass-py-compile-compile | Pickle | 1 d | 0 | R | N | L | AB3 |
| 14 | hacnho/pickle-scanner-bypass-torch-multiprocessing-spawn | Pickle | 1 d | 0 | R | N | L | AB4 |
| 15 | hacnho/poc-joblib-compressed-bypass | Joblib | 1 d | 0 | R | N | L | AB4 |
| 16 | hacnho/pickle-scanner-bypass-poplib-pop3 | Pickle | 1 d | 0 | R | N | L | AB6 |
| 17 | hacnho/pickle-scanner-bypass-smtplib-smtp | Pickle | 1 d | 0 | R | N | L | AB6 |
| 18 | manja316/modelscan-bypass-timeit | Pickle | 6 h | 0 | A | N | E | AB4 |
| 19 | manja316/modelscan-bypass-timeit-repeat | Pickle | 6 h | 0 | A | N | E | AB4 |
| 20 | manja316/modelscan-bypass-pycompile | Pickle | 17 h | 0 | A | N | L | AB3 |
| 21 | manja316/modelscan-bypass-ssl-ssrf | Pickle | 17 h | 0 | A | N | L | AB6 |
| 22 | mscgo77/modelscan-bypass-ftplib | Joblib | 5 d | 0 | A | N | L | AB6 |
| 23 | mscgo77/modelscan-bypass-logging-config | Joblib | 6 d | 0 | A | N | E | AB4 |
| 24 | mscgo77/npy-scanner-bypass-poc | NumPy (.npy/.npz) | 23 d | 0 | A | N | L | AB4, AB6 |
| 25 | rajasingh010/keras-saveable-rce | Pickle | 13 d | 0 | A | N | E | AB4, AB6 |
| 26 | rajasingh010/vllm-torch-rce | PyTorch | 13 d | 0 | A | N | E | AB4, AB6 |
| 27 | Skyflocka/dill-importlib-rce-poc | Dill | 19 d | 0 | A | N | E | AB4 |
| 28 | Skyflocka/joblib-importlib-rce-poc | Joblib | 19 d | 0 | A | N | E | AB4 |
| 29 | Skyflocka/numpy-npy-importlib-rce-poc | NumPy (.npy) | 20 d | 0 | A | N | E | AB4 |
| 30 | Skyflocka/numpy-npz-modelscan-bypass-poc | NumPy (.npz) | 20 d | 0 | A | N | E | AB4 |
| 31 | Skyflocka/pickle-importlib-rce-poc | Pickle | 19 d | 0 | A | N | E | AB4 |
| 32 | Skyflocka/pytorch-importlib-rce-poc | PyTorch | 19 d | 0 | A | N | E | AB4 |
| 33 | TheAuroraAi/modelscan-denylist-gap-poc | Pickle | 11 d | 0 | A | P | L | AB6 |
| 34 | TheAuroraAi/profile-run-bypass-poc | Pickle + PyTorch | 12 d | 0 | A | N | E | AB4 |
| 35 | thisisauser101/picklescan-bypass-poc | Pickle | 17 d | 0 | A | N | E | AB4 |
| 36 | vellaveto/joblib-scanner-bypass-poc | Joblib | 13 d | 192 | A | N | E | AB4, AB6 |
| 37 | vellaveto/mfv-pickle-modelscan-bypass | PyTorch | 13 d | 27 | A | Y | E | AB4 |
| 38 | jorseckh/hazard | Joblib | 5 d | 0 | A | Y | L | AB4 |
| 39 | cgruzicka/test-lora-weights | PyTorch | 3 d | 0 | A | Y | L | AB1, AB4, AB6 |
| 40 | SantanamoDon/huggingface-transformers-poc | PyTorch | 18 d | 0 | A | Y | L | AB4 |
| 41 | abdellahennajari/totally-harmless-model | PyTorch | 20 d | 31 | A | Y | L | AB4, AB8 |
Age at Detection: time between the repository's first commit and detection by MODELSHIELD, reported in days (d) or hours (h). Current Status: A = Active (still hosted as of September 2026), R = Removed. Detected by Hugging Face at Scan Time: whether Hugging Face's malware scanner flagged the model at the time of our scan (Y = Yes, N = No, P = Partial, i.e., some files flagged). Phase: L = Loading, E = Execution. Behavior classes are defined in Table 2. Download counts are cumulative totals recorded at detection time.