malicious crate rustdecimal
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.
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.
When the function was called, it checked whether the GITLAB_CI environment
variable was set, and if so it downloaded a binary payload into
/tmp/git-updater.bin and executed it. The binary payload supported both Linux
and macOS, but not for Windows.
An analysis of the binary payload was not possible, as the download URL didn't
work anymore when the analysis was performed.
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.
In general, we recommend regularly auditing your dependencies, and only
depending on crates whose author you trust. If you notice any suspicious
behavior in a crate's source code please follow [the Rust security
policy][3] and report it to the Rust Security Response WG.
We want to thank GitHub user [@safinaskar][4] for identifying the
malicious crate in [this GitHub issue][1].
[1]: https://github.com/paupino/rust-decimal/issues/514#issuecomment-1115408888
[2]: https://crates.io/crates/rust_decimal
[3]: https://www.rust-lang.org/policies/security
[4]: https://github.com/safinaskar
RUSTSEC-2022-0042 is recorded against 1 package.
Published on 10 May 2022 and last revised on 17 March 2026. No public exploit is currently recorded for this entry. Record sourced from OSV.
crates.io (Package)
rustsec.org (Advisory)
groups.google.com (Web)
rustdecimal has other advisories on record. If you are patching this one, these are worth checking on the same host:
Details
Affected Packages
| Software | From version | Fixed in |
|---|---|---|
| rustdecimal | — | — |
References
Similar Threats
Free Vulnerability Check
BotEraser helps you identify potentially vulnerable plugins and themes by checking your installation against RUSTSEC-2022-0042 and other known CVE records.
Scan My Site Free →No credit card required · Results in minutes
ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.
Stay up to date with the latest from Boteraser.
We use cookies to improve your experience on our site. By using our site, you consent to cookies.
Manage your cookie preferences below:
Essential cookies enable basic functions and are necessary for the proper function of the website.
CloudFlare provides web performance and security solutions, enhancing site speed and protecting against threats.
Service URL: developers.cloudflare.com (opens in a new window)
These cookies are needed for adding comments on this website.
These cookies are used for managing login functionality on this website.
Statistics cookies collect information anonymously. This information helps us understand how visitors use our website.
Google Analytics is a powerful tool that tracks and analyzes website traffic for informed marketing decisions.
Service URL: policies.google.com (opens in a new window)
You can find more information in our Cookie Policy and Privacy Policy.