Project Hyphae
Search

NPM packages targeted again, this time using time!

Share This Post

In a recent threat alert post, Yakir Kadkoda, Security Researcher at Aqua, outlined their discovery of being able to use NPM’s API to execute a timing attack to be able to detect if a private package exists in the manager. What the attack largely comes down to is tracking how long it takes for the server to respond ‘Not Found’, which it will do in both cases of a package not existing, or if the package does exists and is private. However, the time it takes to make the determination is different if the package is private or absent.

If an Attacker is able to determine the name of a company’s private package, through similar naming conventions of a company’s public packages and private, or logs of deleted packages where the packages could have just been made private, and then verify that the package is an active private package, new attack options are opened. The attacker could then create a public package with the same name as the company’s private package, with the hopes that either an employee may grab the copy-cat malicious package, or even in some cases, internal apps will begin defaulting to the available public package of the same name, instead of the private package they should be using.

Both of these outcomes could be ugly!

Aqua has provided several steps to help mitigate the risks of this style of attack against your private packages on NPM.

  1. Gather a list of all your organization’s private and public packages on all the package management platforms.
  2. Actively look for typo squatting, lookalikes, or masquerading packages. Verify that there are no other packages with the same name as your internal private packages.
  3. If you find any similar packages, make sure that they do not contain malware and notify the relevant stakeholders.
  4. If you don’t find public packages similar to your internal packages, consider creating public packages as placeholders to prevent such attacks.
  5. If you would like to learn more about protecting yourself when using npm, you can read the following npm blog “Avoiding npm substitution attacks”.


Reach out to our incident response team for help

More To Explore

Information Security News 4-22-2024

Cisco Duo Warns Third-Party Data Breach Exposed SMS MFA Logs Article Link: https://www.bleepingcomputer.com/news/security/cisco-duo-warns-third-party-data-breach-exposed-sms-mfa-logs/ Notorious Russian Hacking Unit Linked to Breach of Texas Water Facility Article

Information Security News 4-15-2024

Roku Disclosed a Security Incident Impacting 576,000 Accounts Article Link: https://securityaffairs.com/161765/data-breach/roku-second-data-breach.html FBI Warns of Massive Wave of Road Toll SMS Phishing Attacks Article Link: https://www.bleepingcomputer.com/news/security/fbi-warns-of-massive-wave-of-road-toll-sms-phishing-attacks/

Do You Want to Shore Up Your Defenses?

We're opening our first round of threat hunting engagements to 100 organizations. Sign up or join the wait list here.