Maven-Hijack: Software Supply Chain Attack Exploiting Packaging Order

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Reyes, Frank, Bono, Federico, Sharma, Aman, Baudry, Benoit, Monperrus, Martin
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866908619300143104
author Reyes, Frank
Bono, Federico
Sharma, Aman
Baudry, Benoit
Monperrus, Martin
author_facet Reyes, Frank
Bono, Federico
Sharma, Aman
Baudry, Benoit
Monperrus, Martin
contents Java projects frequently rely on package managers such as Maven to manage complex webs of external dependencies. While these tools streamline development, they also introduce subtle risks to the software supply chain. In this paper, we present Maven-Hijack, a novel attack that exploits the order in which Maven packages dependencies and the way the Java Virtual Machine resolves classes at runtime. By injecting a malicious class with the same fully qualified name as a legitimate one into a dependency that is packaged earlier, an attacker can silently override core application behavior without modifying the main codebase or library names. We demonstrate the real-world feasibility of this attack by compromising the Corona-Warn-App, a widely used open-source COVID-19 contact tracing system, and gaining control over its database connection logic. We evaluate three mitigation strategies, such as sealed JARs, Java Modules, and the Maven Enforcer plugin. Our results show that, while Java Modules offer strong protection, the Maven Enforcer plugin with duplicate class detection provides the most practical and effective defense for current Java projects. These findings highlight the urgent need for improved safeguards in Java's build and dependency management processes to prevent stealthy supply chain attacks.
format Preprint
id arxiv_https___arxiv_org_abs_2407_18760
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Maven-Hijack: Software Supply Chain Attack Exploiting Packaging Order
Reyes, Frank
Bono, Federico
Sharma, Aman
Baudry, Benoit
Monperrus, Martin
Cryptography and Security
Software Engineering
Java projects frequently rely on package managers such as Maven to manage complex webs of external dependencies. While these tools streamline development, they also introduce subtle risks to the software supply chain. In this paper, we present Maven-Hijack, a novel attack that exploits the order in which Maven packages dependencies and the way the Java Virtual Machine resolves classes at runtime. By injecting a malicious class with the same fully qualified name as a legitimate one into a dependency that is packaged earlier, an attacker can silently override core application behavior without modifying the main codebase or library names. We demonstrate the real-world feasibility of this attack by compromising the Corona-Warn-App, a widely used open-source COVID-19 contact tracing system, and gaining control over its database connection logic. We evaluate three mitigation strategies, such as sealed JARs, Java Modules, and the Maven Enforcer plugin. Our results show that, while Java Modules offer strong protection, the Maven Enforcer plugin with duplicate class detection provides the most practical and effective defense for current Java projects. These findings highlight the urgent need for improved safeguards in Java's build and dependency management processes to prevent stealthy supply chain attacks.
title Maven-Hijack: Software Supply Chain Attack Exploiting Packaging Order
topic Cryptography and Security
Software Engineering
url https://arxiv.org/abs/2407.18760