CAPEC-693: StarJacking
An adversary spoofs software popularity metadata to deceive users into believing that a maliciously provided package is widely used and originates from a trusted source.
Last updated
Overview
Many open-source software packages are hosted via third-party package managers (e.g., Node Package Manager, PyPi, Yarn, etc.) that allow for easy integration of software components into existing development environments. A package manager will typically include various metadata about the software and often include a link to the package's source code repository, to assist developers in determining the trustworthiness of the software. One common statistic used in this decision-making process is the popularity of the package. This entails checking the amount of "Stars" the package has received, which the package manager displays based on the provided source code repository URL. However, many package managers do not validate the connection between the package and source code repository being provided. Adversaries can thus spoof the popularity statistic of a malicious package by associating a popular source code repository URL with the package. This can ultimately trick developers into unintentionally incorporating the malicious package into their development environment.
How the attack works
The phases an attacker typically follows to carry out this attack.
- Step 1Explore
[Identify target] The adversary must first identify a target package whose popularity statistics will be leveraged. This will be a popular and widely used package, as to increase the perceived pedigree of the malicious package.
- Step 2Experiment
[Spoof package popularity] The adversary provides their malicious package to a package manager and uses the source code repository URL identified in Step 1 to spoof the popularity of the package. This malicious package may also closely resemble the legitimate package whose statistics are being utilized.
- Step 3Exploit
[Exploit victims] The adversary infiltrates development environments with the goal of conducting additional attacks.
- Active: The adversary attempts to trick victims into downloading the malicious package by means such as phishing and social engineering.
- Passive: The adversary waits for victims to download and leverage the malicious package.
What the attacker needs
Prerequisites
- Identification of a popular open-source package whose popularity metadata is to be used for the malicious package.
Skills required
- Low skill: Ability to provide a package to a package manager and associate a popular package's source code repository URL.
Consequences
What a successful CAPEC-693 attack can achieve.
Modify Data
Affects: Integrity
Hide Activities
Affects: Accountability
Execute Unauthorized Commands, Alter Execution Logic, Gain Privileges
Affects: Access Control, Authorization
How to mitigate it
Defenses that reduce the risk of CAPEC-693.
- Before downloading open-source packages, perform precursory metadata checks to determine the author(s), frequency of updates, when the software was last updated, and if the software is widely leveraged.
- Look for conflicting or non-unique repository references to determine if multiple packages share the same repository reference.
- Reference vulnerability databases to determine if the software contains known vulnerabilities.
- Only download open-source packages from reputable package managers.
- After downloading open-source packages, ensure integrity values have not changed.
- Before executing or incorporating the package, leverage automated testing techniques (e.g., static and dynamic analysis) to determine if the software behaves maliciously.
Examples
In April 2022, Checkmarx reported that packages hosted on NPM, PyPi, and Yarn do not properly validate that the provided GitHub repository URL actually pertains to the package being provided. Combined with additional attacks such as TypoSquatting, this allows adversaries to spoof popularity metadata by associating popular GitHub repository URLs with the malicious package. This can further lead to developers unintentionally including the malicious package within their development environments [REF-721].
Frequently asked questions
Common questions about CAPEC-693.
- What is CAPEC-693?
- An adversary spoofs software popularity metadata to deceive users into believing that a maliciously provided package is widely used and originates from a trusted source.
- How does a StarJacking attack work?
- It typically unfolds over 3 phases. It begins with: [Identify target] The adversary must first identify a target package whose popularity statistics will be leveraged. This will be a popular and widely used package, as to increase the perceived pedigree of the malicious package.
- How do you prevent CAPEC-693?
- Before downloading open-source packages, perform precursory metadata checks to determine the author(s), frequency of updates, when the software was last updated, and if the software is widely leveraged.
- What weaknesses does CAPEC-693 target?
- CAPEC-693 exploits 1 CWE weakness, including CWE-494 (Download of Code Without Integrity Check).
- How severe is CAPEC-693?
- MITRE rates CAPEC-693 as High severity with medium likelihood of attack.
References
Attack-pattern data is sourced from the MITRE CAPEC catalog (v3.9). Weakness associations link to the corresponding CWE entries on RadicalNotion.AI.
Defend against CAPEC-693
Track the CVEs and weaknesses attackers exploit with this technique, with AI-written analysis and remediation guidance.