Skip to content

Heap OOB read in extended attribute parsing #28

Description

@TristanInSec

In src/libpst.c:775, the extended attribute parser reads a 4-byte length (tint) from headerbuffer[xattrib.extended] and copies tint bytes from the buffer via memcpy. The guard only checks xattrib.extended < hsize, not that xattrib.extended + 4 + tint <= hsize.

An attacker can set xattrib.extended = hsize - 8 and tint = 65536, causing a 65,280-byte heap over-read.

Triggered on file open during MAPI attribute mapping.

Fix: add bounds check before the memcpy:

if (xattrib.extended + sizeof(tint) + tint > hsize) break;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions