Skip to content

Malicious code in ligbtning-invoice (RubyGems)

Malware Published Oct 5, 2026 to the GitHub Advisory Database • Updated Oct 6, 2026

Package

bundler ligbtning-invoice (RubyGems)

Affected versions

= 1.0.0

Patched versions

None

Description

Source: amazon-inspector (86fdee6169e308a4849aae46edf725272a04cc0fe706f18006dcde8f54f86e2a)

The gem's native extension script extconf.rb, which RubyGems executes automatically during gem install, base64-decodes an embedded Ruby payload and evaluates it inside a double-forked, detached background process. The payload XOR-decodes a hardcoded plain-HTTP URL at 45.138.:8092/wgkit.tar.gz, downloads the tarball to /tmp/.w1.tgz, extracts it, and executes the embedded wg_install.sh via bash, then removes traces. The payload is gated by environment fingerprinting that suppresses execution in CI, sandbox, and analysis environments: it checks CI env vars, hostnames matching firecracker/sandbox/vagrant/uvm, auto-generated usernames, analysis working-directory prefixes (/opt/rubygems, /tmp, /workspace), machine uptime, and the presence of developer artifacts (~/.ssh, ~/.gitconfig, ~/.npmrc, ~/.gem/credentials, ~/.bundle), then sleeps a randomized 20-40 minutes before firing. The shipped library is a hollow stub exposing only a trivial word list (LigbtningInvoice.words/word_at/index_of) and an empty C extension (Init_LigbtningInvoice is a no-op), while the gem name transposes letters relative to a legitimate Lightning/BOLT11 package, indicating a typosquat lure whose sole purpose is delivering the extconf.rb dropper.


Credit: OpenSSF (source)

References

Published to the GitHub Advisory Database Oct 5, 2026
Reviewed Oct 5, 2026
Last updated Oct 6, 2026

EPSS score

Weaknesses

Embedded Malicious Code

The product contains code that appears to be malicious in nature. Learn more on MITRE.

GHSA ID

GHSA-vv4j-hg36-54f8

Source code

No known source code
Improvements are not currently accepted on this advisory because this package is malware and has no patched versions. If there is something to change, please open an issue at https://github.com/github/advisory-database/issues.