Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
Malicious package

rustdecimalcrates.io

Malicious code in rustdecimal (crates.io) Remove it immediately and rotate any exposed credentials.

MAL-2022-1
Immediate action
Remove the package, then rotate any secrets the build/runtime could reach.
remove rustdecimal

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

all versions

Every published version of this package is considered malicious — remove it entirely.

Indicators of compromise (SHA-256)

2e33f42f05c60c6d9f9297bae15a43d6c445e2ad0fd67fa4ef144e5cc79d09c7

Detection & response playbook

Typosquat
  1. Find it

    Scan your lockfiles (package-lock.json, pnpm-lock.yaml, yarn.lock, requirements.txt, poetry.lock, etc.) and build artifacts for rustdecimal (all published versions). O3 Security's supply-chain scanner checks every dependency against known-malicious package intelligence at install time and in CI, flagging rustdecimal across your stack and pipelines.

  2. 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.

  3. Did it already run?

    If rustdecimal was ever installed, its post-install/runtime payload may have already executed. O3's L7 egress monitoring and runtime eBPF sensors detect the credential exfiltration or command-and-control callback after install and block the malicious outbound channel, so you catch and contain the actual compromise — not just the presence of the package.

  4. How O3 protects you

    O3 blocks rustdecimal before install through its supply-chain scanner, and if it has already run, detects and severs the exfiltration or C2 callback at runtime through L7 egress monitoring and eBPF.

Frequently asked questions

No. rustdecimal on crates.io has been identified as a malicious package (all published versions flagged). It should be removed immediately — do not install or keep it in your dependency tree.

Campaign

GHSA-7pwq-f4pq-78gm

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.

rustdecimal (crates.io) malicious package — MAL-2022-1 | O3 Security