T1204.005 - Malicious Library

Sub-technique
Tactics:
Execution
Platforms:
Linux macOS Windows
Detection:
Not specified
Description:
Adversaries may rely on a user installing a malicious library to facilitate execution. Threat actors may [Upload Malware](https://attack.mitre.org/techniques/T1608/001) to package managers such as NPM and PyPi, as well as to public code repositories such as GitHub. User may install libraries without realizing they are malicious, thus bypassing techniques that specifically achieve Initial Access. This can lead to the execution of malicious code, such as code that establishes persistence, steals data, or mines cryptocurrency.(Citation: Datadog Security Labs Malicious PyPi Packages 2024)(Citation: Fortinet Malicious NPM Packages 2023)

In some cases, threat actors may compromise and backdoor existing popular libraries (i.e., [Compromise Software Dependencies and Development Tools](https://attack.mitre.org/techniques/T1195/001)). Alternatively, they may create entirely new packages and leverage behaviors such as typosquatting to encourage users to install them.
Metadata
MITRE ID: T1204.005
STIX ID: attack-pattern--73b24a10-6bf4-...
Platforms: Linux, macOS, Windows
Created: 13/01/2026 17:48
Updated: 14/03/2026 04:00