Variant analysis: 1 unfixed sibling safety gap in pcl
Summary
Variant analysis of historical fixes in pcl identified 1 code site where an integer-overflow guard, bounds check, or safe-allocation wrapper exists at one location but is missing at a structurally identical sibling location (same file, same function, or same pattern family) elsewhere in the codebase.
Each finding below is code-confirmed against the current HEAD (verified by cloning the repository fresh and checking the pattern is still present), with the exact file/line locations, the root cause, a description of the trigger path, and — where available — ASan/execution verification output or a proof-of-concept.
Note on origin: these were surfaced by an automated variant-analysis pipeline that diffs historical fix commits against sibling code paths, then has each candidate manually reviewed. I'm posting them together per-project rather than as separate issues to respect maintainer time. Happy to split, close, or reprioritize any of these as you see fit.
Finding 1: PCL — ASCIIReader triple uint32_t multiply in resize (PLYReader has explicit size_t cast, same allocation pattern)
Verified against HEAD: 2841d826fed1f8ddee4052f18e2d4363c0fd2e46 (2026-09-24)
*- Project: PCL (PointCloudLibrary/pcl)
- Class: Heap-buffer-overflow write (uint32_t * uint32_t * uint32_t computed in 32-bit before size_t promotion, undersized vector allocation → OOB write per-point)
- Status: Code-confirmed, exec-blocked
- Sibling of:
io/src/ply_io.cpp:103—static_cast<std::size_t>(point_step) * width * heightexplicit promotion*
Summary
The ASCII PCD reader computes cloud.height * cloud.width * cloud.point_step as a raw triple uindex_t (uint32_t) multiplication before passing to std::vector::resize(). All three operands are attacker-controlled from the ASCII PCD header. The product wraps in 32-bit before promotion to size_t, yielding an undersized allocation. The per-point parse loop then writes past the buffer. The PLY reader in the same codebase explicitly casts to size_t before multiplying.
Vulnerable code
io/src/ascii_io.cpp line 140
// Lines 118-119: width and height from file header
cloud.height = height; // uindex_t = uint32_t
cloud.width = total; // uint32_t — total non-empty lines in file
// Line 140: triple uint32 multiply → wraps before size_t promotion
cloud.data.resize(cloud.height * cloud.width * cloud.point_step);
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// All operands are uint32_t. Product computed as uint32.
// Attack: height=65536, width=65536, point_step=12
// 65536 * 65536 * 12 = 0xC00000000 → wraps to 0 in uint32
// resize(0) → empty/tiny allocation
// Lines 157-190: per-point parse loop
for (uindex_t i = 0; i < cloud.height; ++i) {
// writes point_step bytes per point into undersized cloud.data[]
parse(tokens[i], fields_[i], data + offset); // OOB write
}Same-codebase sibling fix — PLYReader
io/src/ply_io.cpp line 103
cloud_->data.resize(static_cast<std::size_t>(cloud_->point_step) * cloud_->width * cloud_->height);
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// Explicit cast to size_t BEFORE multiplication — safe on 64-bitThe PLY reader promotes point_step to size_t (64-bit) before the multiply, so width * height is computed in 64-bit. The ASCII reader performs the entire multiply in 32-bit first.
Additional context: no safe allocator exists
PCL has no safe_mul utility, no MUL_OVERFLOW guard, and no centralized overflow-checked allocator. The PLY reader's size_t cast is the ONLY overflow-aware allocation in the entire codebase (aside from a saturating point_step check in PLY reader's list property path at line 362-365).
Attack practicality
- 64-bit platforms: HIGH — the triple uint32 multiply wraps in 32-bit before ever seeing 64-bit size_t
- 32-bit platforms: HIGH — same issue, and even single uint32*sizeof would overflow
- Trigger: ASCII PCD file with
WIDTH/HEIGHTfields set via DATA line count — no per-dimension cap
Root cause
The resize() call trusts that std::vector::resize(size_t) will reject oversized allocations. But the product is computed in uint32_t first — the overflow happens before the size_t conversion. The fix is the PLY reader pattern: static_cast<size_t>(a) * b * c.
Sibling-gap quality
Excellent — same codebase, same allocation pattern, same types, different reader. The ASCII reader is 37 lines of code. Fixing it is a one-character change (add a static_cast<size_t>()).
Analysis date: 2026-09-22. Code-confirmed, not execution-verified. New domain: robotics/3D-point-cloud.
Methodology
For each historical vulnerability fix in the codebase, we identified the safe pattern the fix introduced (an overflow guard, a safe allocator wrapper, a bounds check) and searched the rest of the codebase for structurally identical code that predates or postdates the fix but never received it. Each candidate was then manually verified against the current HEAD listed above.
Happy to provide anything else that would help triage — additional PoC inputs, a minimal patch following the existing safe-sibling pattern, or a written reproduction script.
Source: PointCloudLibrary/pcl