Read the docs
TI-2022-26706 Aliases GHSA-gfgm-chr3-x6px

prettytable-rs: Force cast a &Vec<T> to &[T] may lead to undefined behavior

Priority LOW 38Published · Updated

Key facts

Attack vector
—
Privileges required
—
User interaction
—
Attack complexity
—
Impact type
—
Confidentiality · integrity · availability
—
Fix status
Fixed

No CVSS vector from any source. Fix status from GitHub.

Summary

In function `Table::as_ref`, a reference of vector is force cast to slice. There are multiple problems here: 1. 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). 2. 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).

Why it matters now

Fix Fixed prettytable-rs (crates.io): 0.10.0

SSVC decision points

Not available: CISA has not published SSVC decision points for this record.

Affected products

VendorProductAffected versionsFixed inStatusSource
—prettytable-rs (crates.io)before 0.10.00.10.0Patch availableGHSA-gfgm-chr3-x6px
  • prettytable-rs (crates.io) Vendor— Affected before 0.10.0 Fixed in 0.10.0 Patch available GHSA-gfgm-chr3-x6px

Remediation

  • Fix · GHSA-gfgm-chr3-x6px prettytable-rs (crates.io) Fixed in 0.10.0 Advisory →

Timeline

  1. 2026-10-03 Threatist record created from GHSA-gfgm-chr3-x6px

References

Sources

This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences