GHSA-gfgm-chr3-x6px: prettytable-rs Remote Code Execution Vulnerability
MODERATEGHSA-gfgm-chr3-x6px is a MODERATE remote code execution vulnerability (General Security Weakness) affecting prettytable-rs libraries in the crates.io ecosystem. The issue involves force cast a &vec<t> to &[t] may lead to undefined behavior. Remediation is available by upgrading affected packages to version 0.10.0.
GHSA-gfgm-chr3-x6px at a Glance
How to Fix GHSA-gfgm-chr3-x6px
To remediate this vulnerability, upgrade all affected prettytable-rs 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 prettytable-rs to 0.10.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for prettytable-rs
How to Check if You Are Affected
To determine whether your application is affected by GHSA-gfgm-chr3-x6px, inspect your project dependencies for prettytable-rs:
inspect dependencies for prettytable-rs
Analyze the terminal output to locate any version of prettytable-rs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.10.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 General Security Weakness. In prettytable-rs, 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
GHSA-gfgm-chr3-x6px Affected prettytable-rs Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
prettytable-rs
|
crates.io |
< 0.10.0
|
0.10.0
|
References
Frequently Asked Questions
What is GHSA-gfgm-chr3-x6px?
Which prettytable-rs versions are affected?
What version fixes GHSA-gfgm-chr3-x6px?
Is prettytable-rs affected?
What CWE is associated with GHSA-gfgm-chr3-x6px?
How can I check crates.io dependencies for GHSA-gfgm-chr3-x6px?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-gfgm-chr3-x6px",
"modified" : "2022-12-30T17:48:30Z",
"published" : "2022-12-30T17:48:30Z",
"aliases" : [ ],
"summary" : "prettytable-rs: Force cast a &Vec<T> to &[T] may lead to undefined behavior",
"details" : "In function `Table::as_ref`, a reference of vector is force cast to slice. There are multiple problems here:\n1. To guarantee the size is correct, we have to first do `Vec::shrink_to_fit`. The function requires a mutable reference, so we have to force cast from immutable to mutable, which is undefined behavior (UB).\n2. Even if (1) is sound, `&Vec<T>` and `&[T]` still might not have the same layout. Treating them equally may lead to undefinted behavior (UB).\n",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "prettytable-rs"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.10.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/phsym/prettytable-rs/issues/145"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/phsym/prettytable-rs"
}, {
"type" : "WEB",
"url" : "https://rustsec.org/advisories/RUSTSEC-2022-0074.html"
} ],
"database_specific" : {
"cwe_ids" : [ ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-12-30T17:48:30Z",
"nvd_published_at" : null
}
}