# MAL-2026-17789: Malicious code in hd-wallet-generator (RubyGems)


- **Type:** Malicious package
- **Package:** `hd-wallet-generator` (RubyGems)
- **Published:** 11 Oct 2026

## What is MAL-2026-17789?

MAL-2026-17789 is a malicious package in hd-wallet-generator, published on 11 Oct 2026. 

### Official description

The gem's declared native extension build script ext/hd_wallet_generator/extconf.rb executes a Base64-encoded payload via eval() during `gem install`. The decoded payload opens a TCP socket to the hardcoded remote host 45.138.12.177:8089 and pipes /bin/sh over it (TCPSocket.new + IO.popen(['/bin/sh'],'r+') + IO.copy_stream), granting a remote operator an interactive shell on the installer's host. Execution is wrapped in a double-forked, detached child with a 20–40 minute sleep to decorrelate the connection from the install event. The payload runs only when a battery of evasion checks pass: no CI environment variables, hostname does not match sandbox/firecracker/vagrant/uvm patterns, username does not match generated/analyst patterns (uA\d+, sandbox, tester, analys, scanner), cwd is not under /tmp or /opt/rubygems, machine uptime exceeds 30 minutes, and developer-signal paths exist on disk (~/.ssh, ~/.gitconfig, ~/.gem/credentials, ~/.bundle, ~/.npmrc). No native source files are shipped; create_makefile is a cover stub so the extension-build pretext never actually builds anything. The package metadata name (hd-wallet-generator) and the README description (bitcoin-rpc-lite) disagree, consistent with a disguised dropper.

The OpenSSF Package Analysis project identified 'hd-wallet-generator' @ 0.9.1 (rubygems) as malicious.

It is considered malicious because:

- The package executes one or more commands associated with malicious behavior.

## What should I do about MAL-2026-17789?

Remove the package from your dependencies and lockfiles, then rotate any secrets on machines where it was installed.

## Fix prompt for AI coding agents

```text
MAL-2026-17789 is a malicious package: hd-wallet-generator (RubyGems). Every version was published to cause harm.

Task:
1. Search this repository's dependency manifests and lockfiles for the package, including transitive dependencies.
2. If it is present, remove it, regenerate the lockfile with the project's package manager, and replace whatever it was used for.
3. List any CI runners, developer machines or containers that installed it, so their secrets can be rotated.
4. If the package is not used anywhere, say so and change nothing.

Reference: https://insights.sbomify.com/MAL-2026-17789/ (Markdown: https://insights.sbomify.com/MAL-2026-17789/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/MAL-2026-17789

---
From sbomify Insights: https://insights.sbomify.com/MAL-2026-17789/
Summaries are generated and may contain mistakes; the official description above is the record.
