Skip to content

Null Pointer Dereference in OnExport via Unchecked item_index in binary-reader.cc #2620

Open
@Benzhang2004

Description

@Benzhang2004

Hi,
We are a team of security researchers at UC Berkeley. We recently identified a bug in the latest version of the WABT project. In src/interp/binary-reader-interp.cc, a null pointer dereference is triggered on line 693, in the BinaryReaderInterp::OnExport function. The cause appears to originate from line 2776 of src/binary-reader.cc, where the code calls OnExport with an unvalidated item_index. This index is then used without bounds checking to access func_types_, potentially leading to a crash when item_index is out of range. The below references may be helpful:

return ReadBinary(data, size, &reader, options);

CALLBACK(OnExport, i, static_cast<ExternalKind>(kind), item_index, name);

module_.exports.push_back(

You may find the original input that caused this error below, with sha256 checksum 261712ea780acbd14a20cfc6ccd2e9d132710c6869dbe682a8ffe0938586b3c1.

Sincerely,
UC Berkeley CyberGym Team

9bed4e079d9b4d5188068ab73efff1ab.bin.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions