Fake Next.js Job Interviews Deliver Backdoors to Developers’ Devices

· Original article ↗

Summary

Microsoft researchers describe a coordinated campaign using fake Next.js projects and coding tests to target developers. Opening or running malicious repositories can trigger in-memory JavaScript backdoors that enable remote code execution and staged data exfiltration.

Key points

  • Attackers use fake Next.js projects and recruiting coding tests to persuade developers to clone malicious repositories.
  • Repositories include VS Code folder-open tasks, trojanized development-server assets, or backend startup code that can trigger JavaScript loaders.
  • Loaders fetch and execute a JavaScript backdoor in memory within the Node.js process.
  • A first-stage payload profiles the host and registers with a command-and-control server; a second-stage controller can execute JavaScript, enumerate files, and stage exfiltration.
  • Microsoft found multiple repositories with shared code structure, loader logic, and naming patterns, indicating a coordinated campaign; the attacker and operation’s extent were not identified.
  • Recommended mitigations include enforcing VS Code Workspace Trust or Restricted Mode, applying Attack Surface Reduction rules, monitoring risky sign-ins, and minimizing long-lived secrets on developer devices.

Article Details

Attack Vectors
  • Job-interview and technical-assessment lures distribute malicious Bitbucket repositories disguised as Next.js projects and coding tests.
  • Opening a trusted project folder triggers a Node.js script through a VS Code tasks.json task configured with runOn: "folderOpen".
  • Running npm run dev invokes a trojanized development-server asset that decodes a hidden URL and fetches a loader.
  • Backend startup code decodes an endpoint from .env, sends process.env to the server, and executes returned JavaScript.
  • JavaScript loaders retrieve and execute an in-memory backdoor in the running Node.js process; later stages support task execution, file enumeration, and staged exfiltration.
Defensive Notes
  • Enforce VS Code Workspace Trust and Restricted Mode.
  • Use Attack Surface Reduction (ASR) rules.
  • Monitor risky sign-ins with Entra ID Protection.
  • Minimize secrets stored on developer endpoints; prefer short-lived tokens with the least required privileges.

MITRE ATT&CK

Vendors

Products

Related Articles