Skip to content

In "src/pe_raw_to_virtual.cpp", line 94 ("sections_raw_to_virtual"): #71

Description

@habanada

I'm currently working on a Delphi port and noticed the following:

The header copy is validated with "validate_ptr(payload, destBufferSize, payload, hdrsSize)", which - since "field_bgn == buffer_bgn" - only checks "hdrsSize <= destBufferSize" and never checks "hdrsSize" against the actual source buffer size ("payloadSize"), so a crafted "SizeOfHeaders" larger than "payloadSize" but smaller than "destBufferSize" causes "memcpy(destBuffer, payload, hdrsSize)" to read past the end of "payload". The check should validate against "payloadSize" instead?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions