Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. fruity
  4. ›
  5. CVE-2021-43620

CVE-2021-43620: Improper Input Validation in fruity

November 16, 2021 (updated June 13, 2023)

Methods of NSString for conversion to a string may return a partial result. Since they call CStr::from_ptr on a pointer to the string buffer, the string is terminated at the first null byte, which might not be the end of the string.

In addition to the vulnerable functions listed for this issue, the implementations of Display, PartialEq, PartialOrd, and ToString for NSString are also affected, since they call those functions.

Since NSString is commonly used as the type for paths by the Foundation framework, null byte truncation might allow for easily bypassing file extension checks. For example, if a file name is provided by a user and validated to have one of a specific set of extensions, with validation taking place before truncation, an attacker can add an accepted extension after a null byte (e.g., file.exe\0.txt). After truncation, the file name used by the application would be file.exe.

It would be better to generate unique names for files, instead of using user-provided names, but not all applications take this approach.

References

  • github.com/advisories/GHSA-h352-g5vw-3926
  • github.com/nvzqz/fruity
  • github.com/nvzqz/fruity/issues/14
  • github.com/rustsec/advisory-db/pull/1102
  • nvd.nist.gov/vuln/detail/CVE-2021-43620
  • rustsec.org/advisories/RUSTSEC-2021-0123.html

Code Behaviors & Features

Detect and mitigate CVE-2021-43620 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 0.1.0 before 0.3.0

Fixed versions

  • 0.3.0

Solution

Upgrade to version 0.3.0 or above.

Impact 7.5 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Learn more about CVSS

Weakness

  • CWE-20: Improper Input Validation

Source file

cargo/fruity/CVE-2021-43620.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:16:08 +0000.