Vulnerable Models in the AI Supply Chain: An Empirical Study of Adoption, Propagation, and Usage PatternsVulnerable Models in the AI Supply Chain: An Empirical Study of Adoption, Propagation, and Usage Patterns
The authors tracked 16,977 vulnerable HuggingFace models and found that 3,757 (22.1%) are referenced in GitHub code, and used CPG and FSM to summarize four types of integration patterns.
- Model scanning can flag unsafe artifacts on HuggingFace, but whether developers adopt these models, and how they propagate and integrate them, remains unclear. The authors argue this limits risk assessment and protection at the application layer of the AI supply chain.
- The authors collect 16,977 vulnerable models from Insights DB and trace GitHub code, software packages, fine-tuning chains, and Spaces; then build CPGs for Python non-test files and induce usage patterns through frequent subgraph mining with a TKG constrained by vulnerable-model root nodes.
- 3,757 models (22.1%) are referenced in code at least once, totaling 21,313 occurrences across 5,040 repositories; 185 software packages, 419 downstream child models, and 1,239 Spaces are also found. The authors summarize four types of patterns and state that no provenance verification or model sanitization logic is seen among them.
- The authors note that static code references do not guarantee runtime loading or execution, and cannot capture dynamically constructed identifiers; the scope is constrained by HF scanner coverage and the reliability of automatic labels, and the patterns may not apply to private frameworks, private repositories, or non-Python projects.
- Metrics
- code occurrencesrepositoriespackagesfine-tuned child modelsmodel–space usagesvulnerability-relevant load pathspattern support
Anh Nguyen and other researchers conducted, in an arXiv paper, a large-scale empirical study of the adoption and propagation of 16,977 known-vulnerable models on HuggingFace flagged by InsightDB. These models carry severe vulnerabilities such as unsafe serialization and architectural backdoors, and the study tracked their distribution across GitHub repositories, software packages, fine-tuning chains, and deployed applications. Results show that 3,757 (22.1%) flagged models are still actually referenced by at least one open-source project, appearing in more than 21,000 code locations across over 5,000 open-source repositories. After inducing usage patterns through a pipeline combining code property graph extraction with custom frequent subgraph mining, the authors found no provenance verification or model sanitization logic; developers often bypass security parameters or trust frameworks' permissive defaults. The authors therefore point out that scanning model files alone is insufficient, and that context-aware security analysis and stricter integration guardrails are needed at the application layer of the AI supply chain.
Related events and news
1 events · 0 news mentions
- This event's paper
研究:逾两成漏洞模型仍被开源项目引用
Paper analysis
What problem does this paper attempt to solve?
Study how publicly flagged vulnerability models are adopted, propagated and integrated by downstream code, rather than only scanning model artifacts.
The core question is: how much exposure do flagged vulnerable models on HuggingFace actually cause in downstream software, and through which code structures are they integrated?
- Research setting: The authors focus on deserialization, architectural backdoors, and runtime threats; if a model is never loaded, the actual risk is limited, but loading it with permissive security settings creates a concrete threat.
- Gap in existing work: The authors argue that existing research mainly scans model files or counts threats on hosting platforms, and has limited understanding of developer adoption, ecosystem propagation paths, and integration code patterns.
- Key observation: The authors use lxyuan/distilbert-student as an example: although this model has a security advisory, it still appears in 449 repositories and 82 Spaces, and has 24 fine-tuned sub-models (Figure 1, Section 2.1).
- Research approach: The authors track the exposure of 16,977 vulnerable models in Insights DB across GitHub code, software packages, fine-tuning chains, and HF Spaces, and use CPG and FSM to extract recurring usage patterns.
- Risk boundary: This is a static empirical study of public data and does not carry out attacks; the authors explicitly state that code references and vulnerability-related loading paths do not equal actual or confirmed exploitation (Section 6.3).
What related research exists?
Related work covers model artifact threats, the AI model supply chain, and code graph analysis; this paper turns to downstream real-world use.
Threats to model artifacts and hosting platforms
- Kellas et al. (2025), Liu et al. (2026): the former analyzes pickle deserialization and restricts potentially harmful executable content; the latter studies stealthy pickle payloads that can evade detection such as PickleScan.
- Zhao et al. (2024), Zhu et al. (2025), Li et al. (2021): respectively use control-flow and data-flow queries to detect malicious models, study TensorFlow API architecture backdoors, and propose DEEPPAYLOAD, which injects backdoors into mobile deep learning models.
- Casey et al. (2024), Siddiq et al. (2026), Di Gregorio et al. (2026): study malicious payloads in loading workflows, remote code execution in the hosting ecosystem, and model loading security; the authors state that these works provide limited understanding of downstream real-world integration.
AI model supply chain ecosystem
- Jiang et al. (2022), PeaTMOSS (2024), Yasmin et al. (2026): study pretrained model supply chain risks, support large-scale mining of model reuse, and analyze pretrained models as software dependencies.
- Hu et al. (2025), Huang et al. (2026), Meiklejohn et al. (2025): discuss provenance, integrity, dependency management, and composition risks in the LLM supply chain, and propose countermeasures such as signing and provenance attestation.
- HF governance and Insights DB: HF introduced ProtectAI and JFrog advisory signals; the authors state that, to their knowledge, existing research has not systematically used these sources to analyze adoption, propagation, and usage patterns in real code.
Code graphs and pattern mining
- AST and CPG: AST represents syntactic structure; CPG combines AST, CFG, and PDG and can express data flow and control dependence. The authors consider AST insufficient for tracking propagation after a model identifier is loaded.
- Predefined queries such as MalHug: MalHug by Zhao et al. (2024) uses CFG and data-flow source-sink queries; the authors note that predefined queries can only discover patterns that have already been explicitly specified.
- FSM applications: existing software security research uses graph mining to discover bug signatures, security patch patterns, and API misuse; the authors state that, to their knowledge, FSM has not previously been applied to CPGs of AI model usage code.
Positioning and comparison: this paper has no attack or defense baseline models and no separate model benchmark; the data basis is Insights DB, GitHub, HF Hub, and HF Spaces. The authors position this paper as a complement to artifact scanning: using a data-driven approach to discover integration structures without pre-specifying sinks.
How does the paper address this problem?
The authors first measure exposure across four layers, then mine frequent subgraphs anchored on vulnerable model identifiers from normalized CPGs.
The overall pipeline is divided into two steps, data collection and data analysis (Figure 2): RQ1 measures adoption and propagation, and RQ2 uses CPG + constrained FSM/TKG to discover integration patterns.
Data sources and four-layer exposure measurement
- Vulnerable model set: as of January 2026, 16,977 unique model identifiers were obtained from ProtectAI Insights DB, with threats divided into three categories: deserialization, backdoor, and runtime.
- Code and software packages: use the GitHub Code Search API to perform exact matching on model identifiers, and download matching files and metadata; also record the software packages produced by matching repositories.
- Fine-tuning and applications: reconstruct upstream/downstream relationships through the base_model metadata of the HF Hub API, and query the HF Spaces API to find deployed applications that reference these models.
CPG construction and propagation slicing
- Corpus filtering: keep only Python non-test files, yielding 1,156 candidate files in 817 repositories; the full distribution after splitting by framework is shown in Table 1.
- Unified anchor: replace vulnerable model identifiers in string literals with UNSAFE_MODEL_NAME, then use Joern to generate the CPG, making it a unified LITERAL source node.
- Graph filtering: retain nodes such as IDENTIFIER, CALL, LITERAL, METHOD, IMPORT, BLOCK, and CONTROL_STRUCTURE, as well as AST, CFG, CDG, ARG, CALL, and RD edges.
- Custom slicing: use NetworkX to trace forward from source nodes along RD, locate methods backward along AST, and perform one-hop expansion; the authors state this is to obtain both forward propagation and backward usage context.
Normalization and TKG mining
- Label normalization: merge CALL and METHOD labels by METHOD_FULL_NAME, group boolean literals as TRUE/FALSE, group control structures by type as IF or TRY; collapse BLOCK and ID nodes and deduplicate edges.
- Framework grouping: identify HF-compatible frameworks through call graphs, framework APIs, and import strings, and group unparseable ones under Other, to avoid patterns from high-share frameworks masking other frameworks.
- Root node constraint: customize the TKG to allow expansion only from edges adjacent to LITERAL:UNSAFE_MODEL_NAME, ensuring that every subgraph contains at least one vulnerable model reference.
- Parameter selection: explore k∈{50,100,200}, max edges∈[1,50]; adopt k=50, max edges=50, and the authors report that the search space has saturated and that no pattern exceeds 48 edges.
Pattern merging and vulnerability-relevance determination
- Post-processing: use NetworkX VF2 for subgraph isomorphism filtering and retain maximal patterns; replace leaf nodes with wildcards and merge templates by abstract edge multiset.
- Four motif types: determine Direct Usage (M1), Local Propagation (M2), Method Propagation (M3), and Condition-Guarded Propagation (M4) by dominant edges and nodes; the first author explained the naming, and all authors discussed and finalized it.
- Vulnerability-relevant paths: require that the model has been flagged by Insights DB, and is loaded through a compatible framework or format, lacks the corresponding protection, or explicitly enables unsafe behavior; APIs that only download without consuming the artifact are excluded (Section 5.2.6).
What experiments did the paper conduct?
The experiments measure four layers of exposure, four types of integration motifs, and vulnerability-relevant load paths, and report shared sinks across frameworks.
Experimental setup
- Analysis targets: 16,977 Insights DB vulnerable models; the RQ2 corpus is 1,156 Python non-test files from 817 GitHub repositories (Table 1).
- Four exposure dimensions: GitHub code references, software package distribution, HF upstream/downstream fine-tuning chains, and HF Spaces deployment; statistical definitions are in Table 2.
- Pattern mining: run the customized TKG separately by framework, with k=50 and max edges=50; the raw CPG averages 2,793 nodes and 20,134 edges (Section 6.2).
- Vulnerability path subset: in RQ2, 289 models have relevant threat information, including 237 deserialization, 59 runtime, and 0 backdoor; the analysis focuses on Transformers, PyTorch, Ultralytics, Keras, and TensorFlow.
- Determination method: static CPGs, graph patterns, and the rules in Section 5.2.6 are used for determination, without LLM review or human scoring; motif names were determined through author discussion.
- Runtime cost: the end-to-end run takes 20 hours, of which FSM and VF2 account for 30%; the paper does not report the number of independent repeated runs.
Main results
According to Table 2, the denominator is 16,977 flagged models; “–” indicates that the table does not give a percentage.
Swipe horizontally to read the table
Supply chain dimension Metric Count Share GitHub code Models with at least one code reference 3,757 22.1% GitHub code Unique repositories / code occurrences 5,040 / 21,313 – Software packages Models appearing in package-producing repositories 68 0.4% Software packages Package-producing repositories / unique software packages 111 / 185 – Upstream fine-tuning Models declaring at least one parent 3,765 22.2% Downstream fine-tuning Models with at least one child / total children 136 / 419 0.8% / – HF Spaces Models appearing in at least one Space 657 3.9% HF Spaces model–space links / unique Spaces 1,766 / 1,239 – - Authors' interpretation: public warnings did not prevent downstream adoption; the same model can propagate across code, package, fine-tuning, and deployment layers simultaneously, and a single-layer view cannot fully present exposure.
- Upstream/downstream details: 57 parents and 43 children are also flagged; all children total 22,963 downloads, and Spaces total 10,837 likes (Table 2).
- Exception note: the most-referenced hf-internal-testing/tiny-random-OnnxStableDiffusionPipeline has 976 occurrences across 350 repositories, but the authors note that it is a test model mainly used for CI/CD.
Integration motifs and cross-framework dependencies
- Mining output: the TKG yields 809 patterns, and post-processing leaves 195 maximal patterns, finally grouped into M1–M4; Table 3 gives representative patterns and maximum support for each framework.
- Distribution: M1 covers 11 frameworks, with Transformers and HF Hub at 121 and 66 respectively; M2 covers 12 frameworks, with Transformers, Sherpa, and HF Hub at 115, 76, and 60 respectively.
- Less common propagation: M3 is reported only in Ultralytics and Diffusers at 5 and 3; M4 is 34, 27, and 19 in Other, PyTorch, and HF Hub respectively, and 6 in both Diffusers and Ultralytics (Table 3).
Vulnerability-relevant usage and security configuration
- Path determination: of 554 vulnerability-relevant load paths, 553 (99%) match the vulnerability conditions of the referenced models; 533 of these are deserialization paths (Section 5.2.6).
- Deserialization breakdown: 272 use APIs without deserialization protection, and 261 omit or disable available protection; another 48 Transformers paths explicitly enable trust_remote_code=True.
- Runtime paths: of 20, 16 Keras calls do not use safe_mode, and 4 TensorFlow load_model calls directly load the unsafe SavedModel format.
- Authors' security interpretation: the authors state that no cryptographic provenance verification, hash verification, or model sanitization logic is found in any of the extracted patterns; they also make clear that not every instance is exploitable, and that this does not mean verification is entirely absent (Section 6.1.2).
Other ablations and analyses
- TKG parameters: with k=50 and max edges=50, no pattern exceeds 48 edges; increasing k only brings in lower-support isomorphic subgraphs that are subsequently removed (Section 4.2).
- Spaces SDK: Gradio has 1,019 usages, Docker 113, Streamlit 84, and static deployments 19 (Section 5.1).
- Case propagation: lxyuan/distilbert-student has 594 code occurrences, 449 repositories, 24 children, and 82 Spaces; of the 24 variants, only 4 migrate to SafeTensor (Section 5.1).
- Method comparison: the meta-review in Appendix B notes that the FSM method is not sufficiently compared with simpler alternatives, and that its claim of reducing manual effort is not sufficiently evaluated.
What are some points that can be further explored?
The authors list static analysis, scan coverage and generalization boundaries, and propose directions for developer research and integration-layer defenses.
Limitations noted by the authors and future directions
- Boundary of static references: code-level references do not guarantee runtime loading and execution, and cannot capture dynamically constructed identifiers; results should be understood as an approximation of the potential exposure surface, not confirmed exploitation (Section 6.3).
- Scanner coverage constraints: the study covers only models flagged by HF's built-in scanner and their propagation on GH/HF, excluding other platforms and threats not covered by the scanner; conclusions are constrained by scanner coverage and the reliability of automated labels (Section 6.3).
- Pattern generalization boundary: the authors cannot guarantee that the patterns apply to all integration scenarios, and name proprietary frameworks, private model repositories, and non-Python languages as possibly exhibiting different patterns (Section 6.3).
- Developer behavior research: the authors suggest that developer surveys could clarify security considerations in model selection, and list this as useful future work (Section 6.1.1).
- Defense and tooling directions: the authors recommend making security settings explicit at the point of use, providing warnings or policy gates at the integration layer, hardening shared sinks, and supplementing AIBOM with machine-readable vulnerability records (Section 6.2).
- Issues raised in review: the meta-review states that FSM lacks sufficient comparison with simple alternatives, that the vulnerability usage rules are similar to detection patterns, and that there is no evidence of exploitability for the identified use cases (Appendix B.4).
Scope of experimental coverage
- Ecosystem scope: data come from ProtectAI Insights DB, GitHub, HF Hub, and HF Spaces; the model set is 16,977, and the code corpus is 817 repositories and 1,156 Python non-test files.
- Framework scope: Table 1 lists 16 named categories including Transformers, HF Hub, and PyTorch, plus Other; the vulnerability path analysis goes in depth only into three deserialization frameworks and two runtime frameworks.
- Evidence types: static code references, metadata, CPGs, and rule-based determination are used; no dynamic loading or exploit experiments are run (Section 6.3).
- Runtime information: end-to-end 20 hours, with FSM and VF2 accounting for 30%; the paper does not report independent repeated experiments, inter-annotator agreement, or precision/recall of pattern mining.
Summarize the main content of the paper
This is an empirical study of the AI supply chain that connects vulnerable model advisories with downstream code, packages, fine-tuning chains, and deployment exposure.
This empirical study focuses on the actual use of AI models already flagged by scanners in downstream software, rather than re-detecting the model artifacts themselves.
- Problem: the authors argue that scanning model files alone cannot show whether a model is adopted, how it propagates along the supply chain, or whether the code performs provenance or integrity checks at the point of use.
- Method: starting from the 16,977 vulnerable models in Insights DB, query GitHub, HF Hub, and HF Spaces; then build normalized CPGs for Python non-test code and mine frequent subgraphs with a TKG constrained by vulnerable-model root nodes.
- Adoption scale: 3,757 models (22.1%) have at least one GitHub code reference, totaling 21,313 occurrences across 5,040 repositories; another 68 models appear in package-producing repositories, forming 185 software packages (Table 2).
- Propagation and deployment: 136 models produce 419 downstream children, of which 43 are also flagged; 657 models enter 1,239 unique Spaces, forming 1,766 model–space links (Table 2).
- Code patterns: 809 raw patterns are processed into 195 maximal patterns, grouped into four categories: Direct, Local, Method, and Condition-Guarded; the authors state that no cryptographic provenance verification, hash verification, or sanitization logic is seen in these patterns.
- Conclusion and boundaries: of 554 vulnerability-relevant load paths, 553 (99%) match vulnerability conditions. The authors accordingly argue for moving defenses closer to the integration layer, but emphasize that static exposure does not equal actual exploitation, and that the conclusions are constrained by scanner coverage, the Python corpus, and the generalization scope of the patterns.
Research lineage
2 foundations · 0 follow-ups in libraryNo later in-library follow-ups recorded yet.
Hover or focus a connected paper to inspect the citation context.