Malicious npm Package Targeted Twilio Developers and Exfiltrated API Credentials

· Original article ↗

Summary

ReversingLabs found an npm package posing as a Twilio security probe that collected environment data and attempted to exfiltrate Twilio API credentials. npm removed the package after notification.

Key points

  • The package tw-pkgprobe-7731 published 11 versions on August 14 and was not affiliated with Twilio.
  • Early versions checked for Twilio developer environments and collected environment variables and system details, sending data to a webhook.
  • Version 1.0.4 attempted to exfiltrate Twilio ACCOUNT_SID and AUTH_TOKEN credentials.
  • Some versions searched for Twilio-related account folders and injected files into installed npm packages.
  • Later versions probed Twilio-related hosts; one fetched AWS instance metadata but did not use or exfiltrate it.
  • The package’s bug-bounty claims conflicted with Twilio’s program rules and naming requirements.
  • ReversingLabs notified npm, and the packages were removed about an hour after publication.

Article Details

Attack Vectors
  • Malicious npm package tw-pkgprobe-7731 impersonated an authorized Twilio security research probe.
  • The package extracted environment variables and system details from environments it identified as Twilio developer environments, then sent them via webhook.
  • Versions 1.0.1–1.0.3 searched for Twilio-related folders and, when matching folders were found, injected a custom npm PoC package into installed npm packages and node_modules.
  • Version 1.0.4 attempted to exfiltrate process.env.ACCOUNT_SID and process.env.AUTH_TOKEN over a webhook.
  • The final two versions probed Twilio-related hosts and fetched AWS instance metadata; the article says the metadata was not used or exfiltrated.
Defensive Notes
  • Keep Twilio ACCOUNT_SID and AUTH_TOKEN secret; the article notes that possession of these credentials can enable API requests on the account.
  • Secure CI/CD pipelines and verify that packages used in projects are clean and free of malware.
  • Twilio's bug bounty guidance requires researchers not to expose sensitive information publicly or exfiltrate customer or employee data, and specifies account, test-asset, email, and package-naming requirements.

Indicators of compromise

TypeIndicatorContext
SHA13fb29cf1ef3ce6b187e724c8e7dc4b6a5dfefa50SHA1 hash listed for malicious npm package tw-pkgprobe-7731 version 1.0.1.
SHA17108c1079ac0de030902b049770e8cb822e82055SHA1 hash listed for malicious npm package tw-pkgprobe-7731 version 1.0.2.
SHA1ea40177789e7a1b972c27c61dffff195dd85c544SHA1 hash listed for malicious npm package tw-pkgprobe-7731 version 1.0.0.

MITRE ATT&CK

Products

Related Articles