Malicious code in gmo-payment (RubyGems)
Description
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 webhook.site/require of the gem, exfiltrating to the same webhook endpoint. The file is self-labeled as a malicious native extension hook.
---