{"id":"MAL-2026-17790","summary":"Malicious code in mev-sandwich-detect (RubyGems)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (5d92e0d32c64cdab1627cbfe5bd1d79445d0ff09f4d24336dd9026c02fe46917)\nmev-sandwich-detect 0.9.1 is a stub gem whose only functional behavior is install-time code execution. The gemspec declares a native extension, but ext/extconf.rb ships no C/C++ sources and does not build an addon; instead it base64-decodes an embedded Ruby payload and eval()s it inside a double-forked, detached, output-silenced child process during `gem install`. The decoded payload opens a TCPSocket to the hardcoded host 45.138.12.177 on port 8089 and bridges it to /bin/sh via IO.popen and IO.copy_stream, yielding an interactive shell on the installer's host to the operator of that IP. Execution is gated by anti-analysis checks: the payload exits early if the host appears to be CI, an ephemeral/sandbox VM, a generated analyst username, or running under /tmp or /opt/rubygems analysis paths, and requires uptime over 1800 seconds and the presence of developer-credential artifacts (~/.ssh, ~/.gitconfig, ~/.gem/credentials, ~/.npmrc, ~/.bundle) before dialing out, after sleeping a randomized 20-40 minutes. The lib/ entry point is a 13-line no-op defining only VERSION/build_id/healthy?, and the README is mislabeled as 'bitcoin-rpc-lite'. The native-extension slot exists solely as a lifecycle execution vector for the reverse shell.\n","modified":"2026-10-11T14:30:07.139662127Z","published":"2026-10-11T13:47:48Z","database_specific":{"malicious-packages-origins":[{"id":"IN-MAL-2026-021362","import_time":"2026-10-11T14:17:59.361257767Z","modified_time":"2026-10-11T13:47:48Z","sha256":"5d92e0d32c64cdab1627cbfe5bd1d79445d0ff09f4d24336dd9026c02fe46917","source":"amazon-inspector","versions":["0.9.1"]}]},"references":[{"type":"PACKAGE","url":"https://rubygems.org/gems/mev-sandwich-detect/versions/0.9.1"}],"affected":[{"package":{"name":"mev-sandwich-detect","ecosystem":"RubyGems","purl":"pkg:gem/mev-sandwich-detect"},"versions":["0.9.1"],"database_specific":{"cwes":[{"description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code","cweId":"CWE-506"}],"indicators":{"evidence_files":[{"path":"ext/mev_sandwich_detect/extconf.rb","sha256":"10218e975f54a4f11fe3954e1b584a5f05054003bf5773c3c2b8cceaa74ba763","tlsh":"9751775acf8359e55aa1c0c045798012faa3ab0a50646875f3ee0868ff59b26c0f12fe"}]},"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/rubygems/mev-sandwich-detect/MAL-2026-17790.json"}}],"schema_version":"1.9.0","credits":[{"name":"Amazon Inspector","contact":["inspector-research@amazon.com"],"type":"FINDER"}]}