GHSA-v363-rrf2-5fmj: Ferris says Ferris-says Has Undefined Behavior When Vulnerability

LOW
Published
Advisory Summary

GHSA-v363-rrf2-5fmj is a LOW ferris-says has undefined behavior when vulnerability (General Security Weakness) affecting Ferris says libraries in the crates.io ecosystem. The issue involves ferris-says has undefined behavior when not using utf-8. Remediation is available by upgrading affected packages to version 0.3.1.

GHSA-v363-rrf2-5fmj at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-v363-rrf2-5fmj
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Ferris says
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-v363-rrf2-5fmj

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

ferris-says fixed: 0.3.1
Upgrade ferris-says to 0.3.1
ferris-says fixed: Latest secure release
Upgrade ferris-says 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 ferris-says

How to Check if You Are Affected

To determine whether your application is affected by GHSA-v363-rrf2-5fmj, inspect your project dependencies for Ferris says:

inspect dependencies for ferris-says

Analyze the terminal output to locate any version of Ferris says in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.3.1), 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 Ferris says, 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

Affected versions receive a `&[u8]` from the caller through a safe API, and pass it directly to the unsafe `str::from_utf8_unchecked` function. The behavior of `ferris_says::say` is undefined if the bytes from the caller don't happen to be valid UTF-8. The flaw was corrected in [ferris-says#21] by using the safe `str::from_utf8` instead, and returning an error on invalid input. However this fix has not yet been published to crates.io as a patch version for 0.2. Separately, [ferris-says#32] has introduced a different API for version 0.3 which accepts input as `&str` rather than `&[u8]`, so is unaffected by this bug. [ferris-says#21]: https://github.com/rust-lang/ferris-says/pull/21 [ferris-says#32]: https://github.com/rust-lang/ferris-says/pull/32

GHSA-v363-rrf2-5fmj Affected Ferris says Versions

2 component(s)
Fixed Versions:
0.3.1
Product / Package Ecosystem Affected Versions Fixed Version
ferris-says
crates.io
≥ 0.3.0
< 0.3.1
0.3.1
ferris-says
crates.io
≥ 0.1.2
≤ 0.2.1

References

Frequently Asked Questions

What is GHSA-v363-rrf2-5fmj?
GHSA-v363-rrf2-5fmj is a security vulnerability in Ferris says involving ferris-says has undefined behavior when not using UTF-8 under General Security Weakness.
Which Ferris says versions are affected?
Affected versions include releases prior to 0.3.1 across affected packages: ferris-says.
What version fixes GHSA-v363-rrf2-5fmj?
Upgrading to 0.3.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is ferris-says affected?
Yes, ferris-says is affected in releases prior to 0.3.1, Latest secure release. Upgrade your dependency to 0.3.1, Latest secure release or later.
What CWE is associated with GHSA-v363-rrf2-5fmj?
GHSA-v363-rrf2-5fmj is classified under General Security Weakness.
How can I check crates.io dependencies for GHSA-v363-rrf2-5fmj?
Run the dependency tree command: 'inspect dependencies for ferris-says'. 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-v363-rrf2-5fmj",
  "modified" : "2024-01-17T20:31:11Z",
  "published" : "2024-01-17T20:31:11Z",
  "aliases" : [ ],
  "summary" : "ferris-says has undefined behavior when not using UTF-8",
  "details" : "Affected versions receive a `&[u8]` from the caller through a safe API, and pass it directly to the unsafe `str::from_utf8_unchecked` function.\n\nThe behavior of `ferris_says::say` is undefined if the bytes from the caller don't happen to be valid UTF-8.\n\nThe flaw was corrected in [ferris-says#21] by using the safe `str::from_utf8` instead, and returning an error on invalid input. However this fix has not yet been published to crates.io as a patch version for 0.2.\n\nSeparately, [ferris-says#32] has introduced a different API for version 0.3 which accepts input as `&str` rather than `&[u8]`, so is unaffected by this bug.\n\n[ferris-says#21]: https://github.com/rust-lang/ferris-says/pull/21\n[ferris-says#32]: https://github.com/rust-lang/ferris-says/pull/32",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "ferris-says"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.1.2"
      }, {
        "last_affected" : "0.2.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "ferris-says"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.3.0"
      }, {
        "fixed" : "0.3.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/rust-lang/ferris-says/pull/21"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rust-lang/ferris-says/commit/bb661f29e0d88968c495a4ea4dc63ff0e2c2c11a"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mgattozzi/ferris-says"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2024-0001.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-01-17T20:31:11Z",
    "nvd_published_at" : null
  }
}