ssh-decorate 0.28 through 0.31 on PyPI stole the SSH credentials it handled and sent them to an outside website in May 2018.
In May 2018, attackers published ssh-decorate 0.28 through 0.31 on PyPI. The last good version is 0.27.
What happened
Attackers got into the developer's PyPI account and uploaded four backdoored versions.
- The added code collected the SSH credentials that users passed to the library.
- It sent them to
http://ssh-decorate.cf/index.phpover plain HTTP, so anyone on the network path can read them. - The developer changed his PyPI password.
- He republished the package as
ssh-decorator. - He removed the original from GitHub and PyPI.
A user found the problem in the week of 7 May 2018. It was announced on 8 May.
Affected versions
ssh-decorate0.28, 0.29, 0.30 and 0.31.- Last good version: 0.27.
BleepingComputer and Security Affairs advise users of 0.28 through 0.31 to go back to 0.27 or use the new ssh-decorator package.
Indicators of compromise
- URL:
http://ssh-decorate.cf/index.php. - Package
ssh-decorateat a version from 0.28 to 0.31 in a requirements file, a virtual environment or a Docker image.
How to check
Check the installed version in each environment.
pip show ssh-decorate
Search code and requirement files for the package.
grep -rn "ssh-decorate" requirements*.txt Pipfile* poetry.lock setup.py 2>/dev/null
What to do now
- Uninstall
ssh-decoratefrom every environment. Go back to 0.27 or usessh-decorator. - If a bad version ran, treat every SSH password and key that the code used as stolen. Replace them.
- Check server logs for logins from unknown addresses after May 2018.
- Block
ssh-decorate.cfand search proxy logs for it.
What Vigilance would show
These examples show an install hold and the corresponding owner report.
Example install message
Vigilance blocked `ssh-decorate` 0.28. This version is too new or changed in a way Vigilance must check first.
Example owner report
Bad update
ssh-decorate 0.28
A remote-login helper started copying the usernames, passwords and keys it handled and sending them to an outside website.
No security team? See who reads the alert.
Frequently asked questions
Which versions have the backdoor?
Versions 0.28 through 0.31. Version 0.27 is the last good release.
Does the package still exist under the old name?
No. The developer removed it from GitHub and PyPI and republished it as ssh-decorator.
Sources
Send this page to the person who looks after AI at your company.