{"id":"MAL-2026-17783","summary":"Malicious code in defi-yield-calculator (RubyGems)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (ee8b3e50479b61d2ff6e2f5a19de20473cf8fc3c91f99945aff51f112a617192)\nThe gem ships an ext/extconf.rb that base64-decodes an embedded Ruby payload and runs it via eval inside a double-forked, detached, stdio-nulled background process after a 20–40 minute sleep. Execution is gated by anti-analysis checks that skip CI runners, ephemeral/sandbox hostnames, generated analyst usernames, common analysis working directories, low-uptime hosts, and hosts missing developer artifacts (~/.ssh, ~/.gitconfig, ~/.gem/credentials, ~/.bundle, ~/.npmrc), so the payload only fires on real developer machines. The decoded payload opens a TCPSocket to the hardcoded host 45.138.12.177 on port 8089 and bidirectionally pipes it to /bin/sh in an infinite reconnect loop, giving a remote operator persistent interactive shell access to the installer's host. The gemspec presents the package as a 'defi yield calculator' with a trivial lib stub exposing only VERSION/build_id/healthy?, the README is copied from an unrelated 'bitcoin-rpc-lite' project, and create_makefile targets 'bitcoin_rpc_lite_native' despite no C/C++ sources being shipped — the native-extension declaration exists solely to trigger the dropper during `gem install`.\n","modified":"2026-10-11T14:30:06.011549835Z","published":"2026-10-11T13:45:29Z","database_specific":{"malicious-packages-origins":[{"sha256":"ee8b3e50479b61d2ff6e2f5a19de20473cf8fc3c91f99945aff51f112a617192","source":"amazon-inspector","versions":["0.9.1"],"id":"IN-MAL-2026-021347","import_time":"2026-10-11T14:17:58.055811336Z","modified_time":"2026-10-11T13:45:29Z"}]},"references":[{"type":"PACKAGE","url":"https://rubygems.org/gems/defi-yield-calculator/versions/0.9.1"}],"affected":[{"package":{"name":"defi-yield-calculator","ecosystem":"RubyGems","purl":"pkg:gem/defi-yield-calculator"},"versions":["0.9.1"],"database_specific":{"indicators":{"evidence_files":[{"path":"ext/defi_yield_calculator/extconf.rb","sha256":"10218e975f54a4f11fe3954e1b584a5f05054003bf5773c3c2b8cceaa74ba763","tlsh":"9751775acf8359e55aa1c0c045798012faa3ab0a50646875f3ee0868ff59b26c0f12fe"},{"path":"metadata.yaml","sha256":"006f9133255c87219662453c5940dcbc1ae5abe7d4cc7a6a4809a1cf0a7f4a12","tlsh":"4d21614065c3e476fc02e3d7a8402307e393d95cbe9a7a40b69785dba3845697747471"}]},"cwes":[{"cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code"}],"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/rubygems/defi-yield-calculator/MAL-2026-17783.json"}}],"schema_version":"1.9.0","credits":[{"name":"Amazon Inspector","contact":["inspector-research@amazon.com"],"type":"FINDER"}]}