Security mailing lists by PureSourceCode

RUSTSEC-2022-0042

HIGH

`rustdecimal` is a malicious crate

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.

Published
10 May 2022
Last modified
17 Mar 2026
Also known as
GHSA-7pwq-f4pq-78gmMAL-2022-1
Sources
OSV GHSA-7pwq-f4pq-78gmJSONOSVJSON

Affected

SourceVendor / ecosystemProduct / packageAffected versionsFixed in
OSV crates.io rustdecimal all versions
OSV crates.io rustdecimal >= 0.0.0-0

References

History

  • 25 Nov 2026 20:14 UTC · OSV: first stored (published 10 May 2022)
  • 25 Nov 2026 20:14 UTC · OSV: first stored (published 11 Aug 2022)
An unhandled error has occurred. Reload ×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.