MAL-2026-20211: Malicious code in gmo-payment (RubyGems)
--- -= Per source details. Do not edit below this line.=-
Source: amazon-inspector (4536bede455c58b0be6819cbc85b4566d1c567bfedc370aac7f97a3aacc9776b) The 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 requirerelatives runtimepayload.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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Operational
Rotate or revoke AWS IAM role credentials and database/cache credentials that may have been harvested and exfiltrated.