rustdecimalcrates.io
rustdecimal is a confirmed malicious crates.io package (MAL-2022-1) that typosquats a legitimate package to trick installs. Do not install it — remove it immediately and rotate any exposed credentials.
Malicious code in rustdecimal (crates.io)
What this malware does
The Rust Security Response WG and the crates.io team [were notified][1] on 2022-05-02 of the existence of the malicious crate rustdecimal, which contained malware. The crate name was intentionally similar to the name of the popular [rust_decimal][2] crate, hoping that potential victims would misspell its name (an attack called "typosquatting").
To protect the security of the ecosystem, the crates.io team permanently removed the crate from the registry as soon as it was made aware of the malware. An analysis of all the crates on crates.io was also performed, and no other crate with similar code patterns was found.
Keep in mind that the [rust_decimal][2] crate was not compromised, and it is still safe to use.
Analysis of the crate
The crate had less than 500 downloads since its first release on 2022-03-25, and no crates on the crates.io registry depended on it.
The crate contained identical source code and functionality as the legit rust_decimal crate, except for the Decimal::new function.
If your project or organization is running GitLab CI, we strongly recommend checking whether your project or one of its dependencies depended on the rustdecimal crate, starting from 2022-03-25. If you notice a dependency on that crate, you should consider your CI environment to be compromised.
Malicious versions
Every published version of this package is considered malicious — remove it entirely.
Indicators of compromise (SHA-256)
Detection & response playbook
TyposquatFind it
Search your lockfiles and build artifacts for rustdecimal (all published versions).
If you installed it — respond
rustdecimal is a typosquat — you almost certainly intended a legitimately-named package. Remove rustdecimal, install the correct package, and rotate any secrets exposed during the install since post-install scripts may have already run.
Did it already run?
If rustdecimal was installed, its post-install payload may already have run. Removing the package does not undo that — check outbound connections and credential use from the install window onward.
Frequently asked questions
Campaign
References
Detect & block this
O3 blocks rustdecimal-class packages before install and in CI — and if it already ran, its runtime egress monitoring catches the malicious outbound activity and severs the channel.