Skip to content

Secure IT

Stay Secure. Stay Informed.

Primary Menu
  • Home
  • Sources
    • Krebs On Security
    • Security Week
    • The Hacker News
    • Schneier On Security
  • Home
  • The Hacker News
  • Malicious npm Package Modifies Local ‘ethers’ Library to Launch Reverse Shell Attacks
  • The Hacker News

Malicious npm Package Modifies Local ‘ethers’ Library to Launch Reverse Shell Attacks

[email protected] The Hacker News March 26, 2025
0

Mar 26, 2025Ravie LakshmananSupply Chain Attack / Malware

Malicious npm Package

Cybersecurity researchers have discovered two malicious packages on the npm registry that are designed to infect another locally installed package, underscoring the continued evolution of software supply chain attacks targeting the open-source ecosystem.

The packages in question are ethers-provider2 and ethers-providerz, with the former downloaded 73 times to date since it was published on March 15, 2025. The second package, likely removed by the malware author themselves, did not attract any downloads.

“They were simple downloaders whose malicious payload was cleverly hidden,” ReversingLabs researcher Lucija Valentić said in a report shared with The Hacker News.

Cybersecurity

“The interesting part lay in their second stage, which would ‘patch’ the legitimate npm package ethers, installed locally, with a new file containing the malicious payload. That patched file would ultimately serve a reverse shell.”

The development marks a new escalation of threat actors’ tactics, as uninstalling the rogue packages won’t rid compromised machines of the malicious functionality, since the changes reside in the popular library. On top of that, if an unsuspecting user removes the ethers package when ethers-provider2 remains on the system, it risks reinfection when the package is installed again at a later time.

ReversingLabs’ analysis of ethers-provider2 has revealed that it’s nothing but a trojanized version of the widely-used ssh2 npm package that includes a malicious payload within install.js to retrieve a second-stage malware from a remote server (“5.199.166[.]1:31337/install”), write it to a temporary file, and run it.

Immediately after execution, the temporary file is deleted from the system in an attempt to avoid leaving any traces. The second-stage payload, for its part, starts an infinite loop to check if the npm package ethers is installed locally.

Malicious npm Package

In the event, the package is already present or it gets freshly installed, it springs into action by replacing one of the files named “provider-jsonrpc.js” with a counterfeit version that packs in additional code to fetch and execute a third-stage from the same server. The newly downloaded payload functions as a reverse shell to connect to the threat actor’s server over SSH.

“That means that the connection opened with this client turns into a reverse shell once it receives a custom message from the server,” Valentić said. “Even if the package ethers-provider2 is removed from a compromised system, the client will still be used under certain circumstances, providing a degree of persistence for the attackers.”

It’s worth noting at this stage that the official ethers package on the npm registry is not compromised, since the malicious modifications are made locally post-installation.

Cybersecurity

The second package, ethers-providerz, also behaves in a similar manner in that it attempts to alter files associated with a locally installed npm package called “@ethersproject/providers.” The exact npm package targeted by the library is not known, although source code references indicate it could have been loader.js.

The findings serve to highlight the novel ways threat actors are serving and persisting malware in developer systems, making it essential that packages from open-source repositories are carefully scrutinized before downloading and using them.

“Despite the low download numbers, these packages are powerful and malicious,” Valentić said. “If their mission is successful, they will corrupt the locally installed package ethers and maintain persistence on compromised systems even if that package is removed.”

Found this article interesting? Follow us on Twitter  and LinkedIn to read more exclusive content we post.

About The Author

[email protected] The Hacker News

See author's posts

Original post here

Continue Reading

Previous: macOS Users Warned of New Versions of ReaderUpdate Malware
Next: Vulnerabilities Allow Remote Hacking of Inaba Plant Monitoring Cameras

Trending Now

Hackers Use TikTok Videos to Distribute Vidar and StealC Malware via ClickFix Technique cc.jpg 1

Hackers Use TikTok Videos to Distribute Vidar and StealC Malware via ClickFix Technique

May 23, 2025
ViciousTrap Uses Cisco Flaw to Build Global Honeypot from 5,300 Compromised Devices mm.jpg 2

ViciousTrap Uses Cisco Flaw to Build Global Honeypot from 5,300 Compromised Devices

May 23, 2025
300 Servers and €3.5M Seized as Europol Strikes Ransomware Networks Worldwide ransomware.jpg 3

300 Servers and €3.5M Seized as Europol Strikes Ransomware Networks Worldwide

May 23, 2025
SafeLine WAF: Open Source Web Application Firewall with Zero-Day Detection and Bot Protection safeline.jpg 4

SafeLine WAF: Open Source Web Application Firewall with Zero-Day Detection and Bot Protection

May 23, 2025
U.S. Dismantles DanaBot Malware Network, Charges 16 in $50M Global Cybercrime Operation botnet.jpg 5

U.S. Dismantles DanaBot Malware Network, Charges 16 in $50M Global Cybercrime Operation

May 23, 2025
CISA Warns of Suspected Broader SaaS Attacks Exploiting App Secrets and Cloud Misconfigs saas.jpg 6

CISA Warns of Suspected Broader SaaS Attacks Exploiting App Secrets and Cloud Misconfigs

May 23, 2025

Related Stories

cc.jpg
  • The Hacker News

Hackers Use TikTok Videos to Distribute Vidar and StealC Malware via ClickFix Technique

[email protected] The Hacker News May 23, 2025 0
mm.jpg
  • The Hacker News

ViciousTrap Uses Cisco Flaw to Build Global Honeypot from 5,300 Compromised Devices

[email protected] The Hacker News May 23, 2025 0
ransomware.jpg
  • The Hacker News

300 Servers and €3.5M Seized as Europol Strikes Ransomware Networks Worldwide

[email protected] The Hacker News May 23, 2025 0
safeline.jpg
  • The Hacker News

SafeLine WAF: Open Source Web Application Firewall with Zero-Day Detection and Bot Protection

[email protected] The Hacker News May 23, 2025 0
botnet.jpg
  • The Hacker News

U.S. Dismantles DanaBot Malware Network, Charges 16 in $50M Global Cybercrime Operation

[email protected] The Hacker News May 23, 2025 0
saas.jpg
  • The Hacker News

CISA Warns of Suspected Broader SaaS Attacks Exploiting App Secrets and Cloud Misconfigs

[email protected] The Hacker News May 23, 2025 0

Connect with Us

Social menu is not set. You need to create menu and assign it to Social Menu on Menu Settings.

Trending News

Hackers Use TikTok Videos to Distribute Vidar and StealC Malware via ClickFix Technique cc.jpg 1
  • The Hacker News

Hackers Use TikTok Videos to Distribute Vidar and StealC Malware via ClickFix Technique

May 23, 2025
ViciousTrap Uses Cisco Flaw to Build Global Honeypot from 5,300 Compromised Devices mm.jpg 2
  • The Hacker News

ViciousTrap Uses Cisco Flaw to Build Global Honeypot from 5,300 Compromised Devices

May 23, 2025
300 Servers and €3.5M Seized as Europol Strikes Ransomware Networks Worldwide ransomware.jpg 3
  • The Hacker News

300 Servers and €3.5M Seized as Europol Strikes Ransomware Networks Worldwide

May 23, 2025
SafeLine WAF: Open Source Web Application Firewall with Zero-Day Detection and Bot Protection safeline.jpg 4
  • The Hacker News

SafeLine WAF: Open Source Web Application Firewall with Zero-Day Detection and Bot Protection

May 23, 2025
U.S. Dismantles DanaBot Malware Network, Charges 16 in $50M Global Cybercrime Operation botnet.jpg 5
  • The Hacker News

U.S. Dismantles DanaBot Malware Network, Charges 16 in $50M Global Cybercrime Operation

May 23, 2025
CISA Warns of Suspected Broader SaaS Attacks Exploiting App Secrets and Cloud Misconfigs saas.jpg 6
  • The Hacker News

CISA Warns of Suspected Broader SaaS Attacks Exploiting App Secrets and Cloud Misconfigs

May 23, 2025
GitLab Duo Vulnerability Enabled Attackers to Hijack AI Responses with Hidden Prompts prompt.jpg 7
  • The Hacker News

GitLab Duo Vulnerability Enabled Attackers to Hijack AI Responses with Hidden Prompts

May 23, 2025

You may have missed

cc.jpg
  • The Hacker News

Hackers Use TikTok Videos to Distribute Vidar and StealC Malware via ClickFix Technique

[email protected] The Hacker News May 23, 2025 0
mm.jpg
  • The Hacker News

ViciousTrap Uses Cisco Flaw to Build Global Honeypot from 5,300 Compromised Devices

[email protected] The Hacker News May 23, 2025 0
ransomware.jpg
  • The Hacker News

300 Servers and €3.5M Seized as Europol Strikes Ransomware Networks Worldwide

[email protected] The Hacker News May 23, 2025 0
safeline.jpg
  • The Hacker News

SafeLine WAF: Open Source Web Application Firewall with Zero-Day Detection and Bot Protection

[email protected] The Hacker News May 23, 2025 0
Copyright © 2025 All rights reserved. | MoreNews by AF themes.