#017High2026-04-03

Trojanized Fork of @nestjs/common

@depup/nestjs__common@11.1.18

Veredito:MALICIOUS — Trojanized fork with phantom dependency injection

Visão Geral

A trojanized fork of the official @nestjs/common package published under the @depup scope. Identical to the real package except for an injected phantom dependency 'file-type' not present in the original NestJS package. This phantom dependency can contain arbitrary code that executes when the package is installed. Developers who install @depup/nestjs__common thinking it's a legitimate NestJS variant get the trojanized version with the hidden payload.

NestJS
Impersonating
1
Injected Deps
Fork
Attack Type
@depup
Malicious Scope

Fluxo do Ataque

Legitimate Fork
Package appears to be a legitimate fork of @nestjs/common with version 11.1.18 matching real NestJS versioning.
Phantom Dep Injection
A 'file-type' dependency is injected into package.json that does not exist in the original @nestjs/common. This dependency is the payload carrier.
Transitive Execution
When npm resolves dependencies, the phantom 'file-type' package is installed and can execute arbitrary postinstall scripts.

MITRE ATT&CK Mapeamento

T1195.002Supply Chain Compromise — trojanized fork
T1036.005Masquerading — impersonating @nestjs/common
T1059.007JavaScript Execution — phantom dependency
T1195.001Compromise Software Dependencies — phantom dep injection

Tags

Trojanized ForkNestJSPhantom DependencySupply Chain

Relatório Completo

Dependency Confusion Fork: @depup/nestjs__common

TL;DR

@depup/nestjs__common@11.1.18-depup.0 is a fork of the legitimate @nestjs/common package that injects a phantom dependency file-type@^22.0.0 which never existed in the original. The file-type dep pulls in suspicious sub-dependencies (@tokenizer/inflate, token-types). The package impersonates the official NestJS repository, using the real github.com/nestjs/nest.git as its repo URL. Same attacker pattern as the @depup/miniflare Cloudflare impersonation campaign.

Package Info

FieldValue
Name@depup/nestjs__common
Version11.1.18-depup.0
Claimed AuthorKamil Mysliwiec (the real NestJS creator)
Actual Maintainerchiefmikey (wolfemikl@gmail.com)
Repositorygithub.com/nestjs/nest.git (impersonation of real repo)
Original Package@nestjs/common@11.1.18
LicenseMIT
Published2026-04-03
Risk Score135 (filter: 45, scanner: 90)

Attack Overview

The @depup namespace presents itself as a dependency update service that forks popular packages and "updates their dependencies." In reality, it injects dependencies that never existed in the original package, creating a supply chain injection vector disguised as a helpful upgrade.

Evidence

1. Phantom Dependency Injection

The original @nestjs/common@11.1.18 does not depend on file-type. This fork adds it:

"dependencies": {
  "file-type": "^22.0.0",   // INJECTED — not in original
  "iterare": "1.2.1",        // original
  "load-esm": "1.0.3",       // original
  "tslib": "2.8.1",          // original
  "uid": "2.0.2"             // original
}

The file-type package is never imported in any source file in the extracted package. It exists solely to be pulled into node_modules on install.

2. Suspicious Sub-Dependencies

The phantom file-type dep depends on @tokenizer/inflate and token-types, which are flagged as suspicious packages. These transitive dependencies execute on install and can contain arbitrary code.

3. Repository Impersonation

The package.json claims the official NestJS repository:

"repository": {
  "type": "git",
  "url": "https://github.com/nestjs/nest.git",
  "directory": "packages/common"
}

This is the real NestJS repo URL, making it appear legitimate. The package.json also credits "Kamil Mysliwiec" (the actual NestJS author) as the author.

4. Package Name Mismatch

Scanner detected pkg_repo_mismatch: package name @depup/nestjs__common does not match the claimed repository name nest. This is a strong indicator of impersonation.

5. Social Engineering via depup Metadata

The package includes a depup field designed to look like an automated upgrade:

"depup": {
  "changes": { "file-type": { "from": "21.3.4", "to": "^22.0.0" } },
  "originalPackage": "@nestjs/common",
  "originalVersion": "11.1.18",
  "smokeTest": "passed"
}

This is entirely fabricated. The original @nestjs/common never had file-type at any version. The "from" version 21.3.4 is a lie to make the "upgrade" look routine.

6. Targeted Keywords for Discovery

"keywords": ["@nestjs/common", "depup", "updated-dependencies", "security", "latest", "patched"]

Keywords like "security", "patched", and "latest" are designed to lure developers searching for secure versions of NestJS.

7. Computed Require (Obfuscation Vector)

utils/load-package.util.js line 9 uses a dynamic require:

return loaderFn ? loaderFn() : require(packageName);

While this exists in the original NestJS source, combined with the phantom dependency injection, it provides a mechanism for loading injected code at runtime.

Campaign Context

This package is part of the broader @depup campaign by chiefmikey:

  • @depup/miniflare: Fork of Cloudflare's miniflare with injected dependencies
  • @depup/nestjs__common: Fork of NestJS with injected file-type
  • Same maintainer email: wolfemikl@gmail.com
  • Same pattern: fork popular package, inject phantom dependency, claim repo impersonation

MITRE ATT&CK Mapping

TechniqueIDEvidence
Supply Chain Compromise: Compromise Software DependenciesT1195.001Phantom file-type dependency injected into NestJS fork
Masquerading: Match Legitimate Name or LocationT1036.005Uses real NestJS repo URL and author name
Trusted Developer Utilities Proxy ExecutionT1127Leverages npm dependency resolution to pull malicious deps
Supply Chain Compromise: Compromise Software Supply ChainT1195.002Fork-and-inject attack on popular framework
Subvert Trust ControlsT1553Fabricated "depup" metadata to appear as automated security update

Verdict

Malicious — Dependency Injection via Fork Impersonation. The package masquerades as an updated version of @nestjs/common while injecting a phantom dependency with suspicious transitive dependencies. The use of the real NestJS repository URL and author name is deliberate impersonation. Part of a multi-package campaign targeting popular frameworks.

Remediation

npm uninstall @depup/nestjs__common
# Install the real package instead:
npm install @nestjs/common

Credits

  • Discovered by: Yuri Borges Martins
  • Tool: npm-sentinel (AI-Powered NPM Malware Hunter)
  • Date: 2026-04-03