Malicious code in hd-wallet-generator (RubyGems)
Description
The RubyGem package hd-wallet-generator version 0.9.1 contains malicious code embedded in its native extension build script. During installation, it decodes and executes a payload that opens a remote TCP shell to a hardcoded IP address, allowing remote command execution on the installer's machine. The payload includes multiple evasion checks to avoid detection in sandbox or analysis environments. No legitimate native code is built; the extension build script is a decoy. The package metadata and README are inconsistent, indicating a disguised dropper.
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The hd-wallet-generator RubyGem version 0.9.1 includes a malicious native extension build script (ext/hd_wallet_generator/extconf.rb) that executes a Base64-encoded payload via eval() during gem installation. This payload establishes a TCP connection to 45.138.12.177:8089 and pipes an interactive /bin/sh shell over it, granting remote shell access. The execution is performed in a double-forked detached child process with a delayed connection to obscure timing. The payload activates only after passing several evasion checks, including absence of CI environment variables, hostname and username pattern checks, working directory exclusions, machine uptime over 30 minutes, and presence of developer-related files. The extension build script does not compile any native code, serving only as a cover for the malicious payload. The package metadata and README description mismatch further suggest the package is a disguised dropper.
Potential Impact
Successful installation of this package version results in remote code execution on the installer's system via a reverse shell to a hardcoded attacker-controlled IP address. This compromises the confidentiality, integrity, and availability of the affected host by allowing an attacker interactive shell access. The evasion techniques reduce the likelihood of detection during automated or sandboxed installs, increasing the risk of stealthy compromise.
Mitigation Recommendations
No official patch or remediation is currently documented. Users should avoid installing hd-wallet-generator version 0.9.1. Verify package integrity and source before installation. Consider removing the package if already installed. Monitor for any unauthorized network connections to the IP 45.138.12.177:8089 and investigate any suspicious activity. Patch status is not yet confirmed — check the vendor advisory or RubyGems security announcements for updates.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-17789
- Osv Schema Version
- 1.7.4
- Ecosystems
- ["RubyGems"]
Threat ID: 6acc00a32cdf04f656fecb47
Added to database: 10/11/2026, 21:33:23 UTC
Last enriched: 10/11/2026, 21:45:59 UTC
Last updated: 10/11/2026, 21:45:59 UTC
Views: 2
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.