CAPEC-695

Repo Jacking
Moyen
Haute
Stable
2022-09-29
00h00 +00:00
2023-01-24
00h00 +00:00
Alerte pour un CAPEC
Restez informé de toutes modifications pour un CAPEC spécifique.
Gestion des notifications

Descriptions du CAPEC

An adversary takes advantage of the redirect property of directly linked Version Control System (VCS) repositories to trick users into incorporating malicious code into their applications.

Informations du CAPEC

Flux d'exécution

1) Explore

[Identify target] The adversary must first identify a target repository that is commonly used and whose owner/maintainer has either changed/deleted their username or transferred ownership of the repository and then deleted their account. The target should typically be a popular and widely used package, as to increase the scope of the attack.

2) Experiment

[Recreate initial repository path] The adversary re-registers the account that was renamed/deleted by the target repository's owner/maintainer and recreates the target repository with malicious code intended to exploit an application. These steps may need to happen in reverse (i.e., recreate repository and then rename an existing account to the target account) if protections are in place to prevent repository reuse.

3) Exploit

[Exploit victims] The adversary's malicious code is incorporated into applications that directly reference the initial repository, which further allows the adversary to conduct additional attacks.

Conditions préalables

Identification of a popular repository that may be directly referenced in numerous software applications
A repository owner/maintainer who has recently changed their username or deleted their account

Compétences requises

Ability to create an account on a VCS hosting site and recreate an existing directory structure.
Ability to create malware that can exploit various software applications.

Atténuations

Leverage dedicated package managers instead of directly linking to VCS repositories.
Utilize version pinning and lock files to prevent use of maliciously modified repositories.
Implement "vendoring" (i.e., including third-party dependencies locally) and leverage automated testing techniques (e.g., static analysis) to determine if the software behaves maliciously.
Leverage automated tools, such as Checkmarx's "ChainJacking" tool, to determine susceptibility to Repo Jacking attacks.

Faiblesses connexes

CWE-ID Nom de la faiblesse

CWE-494

Download of Code Without Integrity Check
The product downloads source code or an executable from a remote location and executes the code without sufficiently verifying the origin and integrity of the code.

CWE-829

Inclusion of Functionality from Untrusted Control Sphere
The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere.

Références

REF-722

Repo Jacking: Exploiting the Dependency Supply Chain
Indiana Moreau.
https://www.concretecms.org/about/project-news/security/supply-chain-hack-phpass-repo-jacking

REF-732

CyRC Vulnerability Analysis: Repo jacking in the software supply chain
Theo Burton.
https://www.synopsys.com/blogs/software-security/cyrc-vulnerability-analysis-repo-jacking/

REF-733

Attacker Caught Hijacking Packages Using Multiple Techniques to Steal AWS Credentials
Jossef Harush.
https://checkmarx.com/blog/attacker-caught-hijacking-packages-using-multiple-techniques-to-steal-aws-credentials/

REF-734

GitHub RepoJacking Weakness Exploited in the Wild by Attackers
Jossef Harush.
https://checkmarx.com/blog/github-repojacking-weakness-exploited-in-the-wild-by-attackers/

Soumission

Nom Organisation Date Date de publication
CAPEC Content Team The MITRE Corporation 2022-09-29 +00:00

Modifications

Nom Organisation Date Commentaire
CAPEC Content Team The MITRE Corporation 2023-01-24 +00:00 Updated Related_Weaknesses