cve.bz

CAPEC-695

Repo Jacking

High severityMedium likelihoodDetailed pattern

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.

On this page

Software developers may directly reference a VCS repository (i.e., via a hardcoded URL) within source code to integrate the repository as a dependency for the underlying application. If the repository owner/maintainer modifies the repository name, changes their VCS username, or transfers ownership of the repository, the VCS implements a redirect to the new repository location so that existing software referencing the repository will not break. However, if the original location of the repository is reestablished, the VCS will revert to resolving the hardcoded path. Adversaries may, therefore, re-register deleted or previously used usernames and recreate repositories with malicious code to infect applications referencing the repository. When an application then fetches the desired dependency, it will now reference the adversary's malicious repository since the hardcoded repository path is once again active. This ultimately allows the adversary to infect numerous applications, while achieving a variety of negative technical impacts.

Ask an AI about this attack pattern

Show the promptExplain the attack pattern CAPEC-695: Repo Jacking: how it unfolds, what it needs and how to prevent and detect it in my systems. Use https://capec.mitre.org/data/definitions/695.html and https://cve.bz/cve/capec/695?via=ask-ai-copy, which lists recent CVEs with the weaknesses it exploits. Cite the sources.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this attack pattern's id and public links.

How the attack unfolds

  1. Explore

    The attacker looks for a way in.

    1. [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

    They probe what they found.

    1. [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

    They carry out the attack.

    1. [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.

Prerequisites

  • 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

Skills required

  • Low skill

    Ability to create an account on a VCS hosting site and recreate an existing directory structure.

  • Low skill

    Ability to create malware that can exploit various software applications.

Consequences

What a successful attack can lead to
ImpactAffectsNote
Read Data, Modify DataIntegrity
Execute Unauthorized Commands, Alter Execution Logic, Gain PrivilegesAccess Control, Authorization

Mitigations

  • 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.

Weaknesses it exploits

  • CWE-494 Download of Code Without Integrity Check
  • CWE-829 Inclusion of Functionality from Untrusted Control Sphere

Recent CVEs with these weaknesses

  1. 8.4CVE-2026-128115

    claw-code versions 0.1.11 through 0.1.16 load stdio MCP server definitions from project-controlled configuration files and start their configured commands during startup tool discovery. A repository can therefore cause a program to execute…

  2. 7.8CVE-2026-137191

    Vite+ is a unified toolchain and entry point for web development. From 0.2.9 until 1.5.1, the global vp setup path downloads the pinned pnpm package manager through download_package_manager and executes it without comparing the bytes to a …

  3. 8.4CVE-2026-80453

    Dell Secure Connect Gateway - Virtual Edition, versions prior to 5.36.00.16, contains a Download of Code Without Integrity Check vulnerability. An unauthenticated local attacker could potentially exploit this vulnerability, leading to Unau…

  4. 7.8CVE-2026-80364

    Dell Secure Connect Gateway (SCG) Virtual Edition, versions prior to 5.36.00.16, contains a Download of Code Without Integrity Check vulnerability. A low privileged local attacker could potentially exploit this vulnerability, leading to fu…

  5. 7.7CVE-2026-134638

    Webmin through 2.670 contains a missing integrity verification vulnerability in usermin/upgrade.cgi that downloads Usermin upgrade packages over plaintext HTTP without signature or digest checks. On-path network attackers or DNS spoofers c…

  6. 7.7CVE-2026-134630

    Webmin through 2.670 contains a remote code execution vulnerability in the Perl Modules (cpan) module, which downloads CPAN indexes and module archives over plaintext HTTP without checksum or signature verification. On-path network attacke…

  7. 7.7CVE-2026-134438

    Webmin through 2.670 contains an insecure download vulnerability in webmin/upgrade.cgi, cluster-webmin/upgrade.cgi and cluster-usermin/upgrade.cgi that fetches upgrade packages over plaintext HTTP with GnuPG signature verification disabled…

  8. 8.1CVE-2026-135802

    When Request::getBaseUrl() does not find the script name at the start of the request URI, it looks for it further into the path. This supports web servers that rewrite every URL to a front controller in a subdirectory. The base URL then ke…

The newest records naming one of them. Each weakness's page lists them all.

Part of

Examples

In May 2022, the CTX Python package and PhPass PHP package were both exploited by the same adversary via Repo…

In May 2022, the CTX Python package and PhPass PHP package were both exploited by the same adversary via Repo Jacking attacks. For the CTX package, the adversary performed an account takeover via a password reset, due to an expired domain-hosting email. The attack on PhPass entailed bypassing GitHub's authentication for retired repositories. In both cases, sensitive data in the form of API keys and passwords, each stored in the form of environment variables, were exfiltrated. [REF-732] [REF-733]

In October 2021, the popular JavaScript library UAParser.js was exploited via the takeover of the author's No…

In October 2021, the popular JavaScript library UAParser.js was exploited via the takeover of the author's Node Package Manager (NPM) account. The adversary-provided malware downloaded and executed binaries from a remote server to conduct crypto-mining and to exfiltrate sensitive data on Windows systems. This was a wide-scale attack as the package receives 8 to 9 million downloads per week. [REF-732]

MITRE's words, unchanged: CAPEC-695 at MITRE. CAPEC is Copyright © 2007–2026, The MITRE Corporation, used under the CAPEC terms of use: “The MITRE Corporation (MITRE) hereby grants you a non-exclusive, royalty-free license to use Common Attack Pattern Enumeration and Classification (CAPEC™) for research, development, and commercial purposes. Any copy you make for such purposes is authorized provided that you reproduce MITRE’s copyright designation and this license in any such copy.” CAPEC and the CAPEC logo are trademarks of The MITRE Corporation. Credits. All attack patterns.