Skip to content
NewCybercrime Report 2026 · Eight Chapters · A Post Is Not An Incident → Explore The ChaptersCybercrime Report 2026 → Explore

User Execution: Malicious Library (T1204.005): Detection and Defense

MITRE ATT&CK describes User Execution: Malicious Library (T1204.005) as an attacker relying on a person to install a harmful software library.

Reviewed by
Brandefense Analyst Team
Published
Reading Time
2 min read
Abstract package block entering a monitored workflow

The install can lead to code running on the user's device. Analysts need the package install event and what happened next to judge whether the activity was malicious.

How it works

MITRE places this action under User Execution (T1204). An attacker can publish a new package or alter a dependency that a developer installs through a package manager. The malicious package can run code during or after that work. This is the user’s install action, while Supply Chain Compromise (T1195) describes tampering with software or its delivery path.

MITRE’s DET0252 detection strategy joins the package manager event to later activity on the same endpoint. Look for an unusual child process, a new startup file, credential access or a network connection after the install. An install alone is weak evidence because approved packages also create files and start processes; compare the source, task, process lineage and timing. A Cyber Threat Intelligence workflow can add context to a package alert, but the endpoint sequence still needs review.

The related Malicious Copy and Paste (T1204.004) covers a person running pasted commands. Here, the key action is installing a library. Socket’s research shows why a developer should inspect a project before building it: a package reference can bring in code that acts during a build or when the application runs.

A real example

Socket reported on 23 November 2026 that fake .NET job assessments referenced malicious NuGet packages. Its researchers found that building or running a project with those packages could fetch files or start other code. Socket did not attribute this operation to a named threat actor. The case shows why an assessment project and its package sources should be reviewed before a developer builds it.

How to detect

  1. Join the install to later activity

    MITRE DET0252 calls for correlating a user initiated package manager install with later network connections, credential access or startup file changes. Keep the user, device and time window together.

  2. Inspect child processes and file writes

    MITRE AN0699 describes package installation followed by an unusual script interpreter, child process or write in a user data folder. Review process lineage and compare it with the developer's expected build task.

  3. Review build behavior in developer projects

    Socket recommends checking unexpected package references and build hooks before running a take home project. Its case also supports reviewing a build tool that starts a bundled library or an unrelated process.

How to defend

  1. Use approved package sources

    MITRE M1033 recommends that developers pull verified and approved packages from an internal repository where possible. Review exceptions that permit external or local package feeds.

  2. Teach developers to check package changes

    MITRE M1017 recommends training developers about malicious libraries. Socket advises reviewing unfamiliar dependencies and package sources before building an outside project.

  3. Limit exposure when testing outside code

    Socket recommends building untrusted assessments in a disposable environment without access to developer credentials. Check package source settings and review project changes before the build.

Frequently Asked Questions

Does a package install alone prove T1204.005?

No. MITRE DET0252 links the install to unusual later behavior. Check the package source, user task, process lineage and network or file activity before classifying the event.

How does T1204.005 differ from T1204.004?

MITRE uses T1204.005 for a user installing a malicious library. T1204.004 covers a user copying and running malicious commands. A case can involve both actions, but they describe different user steps.

What is the main preventive control?

MITRE M1033 recommends approved packages from internal repositories where possible. Socket also recommends restricting project package feeds and reviewing unfamiliar dependencies before a build.

Sources

  1. User Execution: Malicious Library, T1204.005MITRE ATT&CK
  2. User Execution, T1204MITRE ATT&CK
  3. User Execution: Malicious Copy and Paste, T1204.004MITRE ATT&CK
  4. Supply Chain Compromise, T1195MITRE ATT&CK
  5. User-Initiated Malicious Library Installation via Package Manager, DET0252MITRE ATT&CK
  6. 13 Malicious NuGet Packages Target .NET Developers With Fake Job AssessmentsSocket
ShareLinkedInX
Brandefense logo

Stay Ahead of Digital Threats.

Take control of your digital security with an exclusive demo of our AI-driven threat intelligence platform.

Open The Full Demo Form →