CVE-2021-43620: Fruity Improper Input Validation Vulnerability
HIGHCVE-2021-43620 is a HIGH (CVSS 7.5) improper input validation vulnerability (CWE-20: Improper Input Validation) affecting Fruity libraries in the crates.io ecosystem. The issue involves improper input validation in fruity. Remediation is available by upgrading affected packages to version 0.3.0.
CVE-2021-43620 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N).
How to Fix CVE-2021-43620
To remediate this vulnerability, upgrade all affected Fruity dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade fruity to 0.3.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for fruity
How to Check if You Are Affected
To determine whether your application is affected by CVE-2021-43620, inspect your project dependencies for Fruity:
inspect dependencies for fruity
Analyze the terminal output to locate any version of Fruity in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.3.0), 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 CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Fruity, 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
CVE-2021-43620 Affected Fruity Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
fruity
|
crates.io |
≥ 0.1.0
< 0.3.0
|
0.3.0
|
References
Frequently Asked Questions
What is CVE-2021-43620?
Which Fruity versions are affected?
What version fixes CVE-2021-43620?
Is fruity affected?
What is the CVSS score of CVE-2021-43620?
What CWE is associated with CVE-2021-43620?
How can I check crates.io dependencies for CVE-2021-43620?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-h352-g5vw-3926",
"modified" : "2023-06-13T17:27:02Z",
"published" : "2021-11-16T17:26:47Z",
"aliases" : [ "CVE-2021-43620" ],
"summary" : "Improper Input Validation in fruity",
"details" : "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.\n\nIn 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.\n\nSince 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.\n\nIt would be better to generate unique names for files, instead of using user-provided names, but not all applications take this approach.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "fruity"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.1.0"
}, {
"fixed" : "0.3.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-43620"
}, {
"type" : "WEB",
"url" : "https://github.com/nvzqz/fruity/issues/14"
}, {
"type" : "WEB",
"url" : "https://github.com/rustsec/advisory-db/pull/1102"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/nvzqz/fruity"
}, {
"type" : "WEB",
"url" : "https://rustsec.org/advisories/RUSTSEC-2021-0123.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2021-11-16T15:32:42Z",
"nvd_published_at" : "2021-11-15T05:15:00Z"
}
}