{"id":"MAL-2026-20211","summary":"Malicious code in gmo-payment (RubyGems)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (4536bede455c58b0be6819cbc85b4566d1c567bfedc370aac7f97a3aacc9776b)\nThe gem ships a native-extension build script (extconf.rb) that runs automatically during `gem install`. It collects host identifiers (hostname, whoami, uname output, working directory, local IPv4), queries the AWS Instance Metadata Service (both IMDSv1 and IMDSv2) to retrieve IAM role security credentials, pulls ECS task metadata, harvests environment variables matching DATABASE/DB_/MYSQL/AURORA/POSTGRES/REDIS/RDS, and POSTs the collected data to the hardcoded endpoint https://webhook.site/4b2354a7-67fd-4641-92ac-e18bac8c09e8. The script then writes an empty Makefile to disguise the lack of an actual build. A second stage in lib/gmo/payment.rb unconditionally require_relatives runtime_payload.rb, whose top-level code repeats the same IMDS credential fetch, ECS metadata lookup, and database/cache environment variable harvest on every `require` of the gem, exfiltrating to the same webhook endpoint. The file is self-labeled as a malicious native extension hook.\n","modified":"2026-11-19T09:15:03.744156656Z","published":"2026-11-19T09:08:19Z","database_specific":{"malicious-packages-origins":[{"modified_time":"2026-11-19T09:08:19Z","sha256":"4536bede455c58b0be6819cbc85b4566d1c567bfedc370aac7f97a3aacc9776b","source":"amazon-inspector","versions":["0.0.99"],"id":"IN-MAL-2026-022887","import_time":"2026-11-19T09:13:05.161892246Z"}]},"references":[{"type":"PACKAGE","url":"https://rubygems.org/gems/gmo-payment/versions/0.0.99"}],"affected":[{"package":{"name":"gmo-payment","ecosystem":"RubyGems","purl":"pkg:gem/gmo-payment"},"versions":["0.0.99"],"database_specific":{"cwes":[{"name":"Embedded Malicious Code","cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature."}],"indicators":{"evidence_files":[{"path":"ext/gmo-payment/extconf.rb","sha256":"45855ecfdd3577b4a1b5ef0d0bc78ce74931051925ae30aa6b87b56c554a9b66","tlsh":"82417545a6d93462da949571fc1e42137b11e70f1e8c2650aec04ecd1fade3bb2336e1"},{"tlsh":"04415589ead93472da945571fc1902126b11e70f1a882b50aed08edd1f6cf3bf1376e0","path":"lib/runtime_payload.rb","sha256":"3722a762ad6ab7bc694d3e19e806bd221d1530d5b1cbe8a2a92825d6d4ba278c"}],"package_integrity":[{"filename":"gmo-payment-0.0.99.gem","hashes":{"sha256":"2ea2b445f3826fabc868b89da6dc6c77b9a7c3c6a89db9e04b003b04f86a6d3b"}}]},"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/rubygems/gmo-payment/MAL-2026-20211.json"}}],"schema_version":"1.9.2","credits":[{"name":"Amazon Inspector","contact":["inspector-research@amazon.com"],"type":"FINDER"}]}