GHSA-7pwq-f4pq-78gm: Rustdecimal `rustdecimal` Is A Malicious Crate Vulnerability

HIGH
Published
Advisory Summary

GHSA-7pwq-f4pq-78gm is a HIGH `rustdecimal` is a malicious crate vulnerability (General Security Weakness) affecting Rustdecimal libraries in the crates.io ecosystem. The issue involves `rustdecimal` is a malicious crate. Remediation is available in the latest vendor maintenance releases.

GHSA-7pwq-f4pq-78gm at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-7pwq-f4pq-78gm
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Rustdecimal
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-7pwq-f4pq-78gm

To remediate this vulnerability, upgrade all affected Rustdecimal dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

rustdecimal fixed: Latest secure release
Upgrade rustdecimal to Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for rustdecimal

How to Check if You Are Affected

To determine whether your application is affected by GHSA-7pwq-f4pq-78gm, inspect your project dependencies for Rustdecimal:

inspect dependencies for rustdecimal

Analyze the terminal output to locate any version of Rustdecimal in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under General Security Weakness. In Rustdecimal, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

GHSA-7pwq-f4pq-78gm Affected Rustdecimal Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
rustdecimal
crates.io

References

Frequently Asked Questions

What is GHSA-7pwq-f4pq-78gm?
GHSA-7pwq-f4pq-78gm is a security vulnerability in Rustdecimal involving `rustdecimal` is a malicious crate under General Security Weakness.
Which Rustdecimal versions are affected?
Affected versions include releases prior to current release patches across affected packages: rustdecimal.
What version fixes GHSA-7pwq-f4pq-78gm?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is rustdecimal affected?
Yes, rustdecimal is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What CWE is associated with GHSA-7pwq-f4pq-78gm?
GHSA-7pwq-f4pq-78gm is classified under General Security Weakness.
How can I check crates.io dependencies for GHSA-7pwq-f4pq-78gm?
Run the dependency tree command: 'inspect dependencies for rustdecimal'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-7pwq-f4pq-78gm",
  "modified" : "2022-08-11T15:43:35Z",
  "published" : "2022-08-11T15:43:35Z",
  "aliases" : [ ],
  "summary" : "`rustdecimal` is a malicious crate",
  "details" : "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\").\n\nTo 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.\n\nKeep in mind that the [`rust_decimal`][2] crate was **not** compromised, and it is still safe to use.\n\n## Analysis of the crate\n\nThe 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.\n\nThe crate contained identical source code and functionality as the legit `rust_decimal` crate, except for the `Decimal::new` function.\n\nIf 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.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "rustdecimal"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/paupino/rust-decimal/issues/514#issuecomment-1115408888"
  }, {
    "type" : "WEB",
    "url" : "https://groups.google.com/g/rustlang-security-announcements/c/5DVtC8pgJLw?pli=1"
  }, {
    "type" : "WEB",
    "url" : "https://raw.globalsecuritydatabase.org/GSD-2022-1002520"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2022-0042.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-08-11T15:43:35Z",
    "nvd_published_at" : null
  }
}