Skip to content

← Public intelligence

crates.io package

prettytable-rs

Open actionable advisories and recorded vendor fixes. This public package view has no inventory attached and cannot establish whether your deployment is affected. A vendor fix never resolves your finding; verify your installed version and the source guidance.

Open advisories

1 actionable advisory, newest first. Withdrawn advisories and news are excluded. Coverage is partial.

  1. Unratedcrates.ioPublished

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

    GHSA-gfgm-chr3-x6px

    Affected
    • crates.io prettytable-rs < 0.10.0
    Fixed in
    0.10.0· Vendor fix available
    Issue
    In function Table::asref, 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::shrinktofit. 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).

    Recommended action: Upgrade to 0.10.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →