Skip to content

BUG: Buffer boundary not validated in MIME parsing #813

@andrinoff

Description

@andrinoff

Describe the bug
MIME boundary extraction at fetcher/fetcher.go:1120 doesn't validate endIdx > 0 before accessing endIdx-1. Boundary at position 0 causes panic.

To reproduce

  1. Send email with malformed MIME boundary at position 0
  2. Access rawEmail[endIdx-1] when endIdx=0
  3. Index out of bounds panic

Expected behavior
Check endIdx > 1 before accessing endIdx-1

Matcha version
master

OS
All

Additional context
File: fetcher/fetcher.go line 1120
Edge case in malformed MIME

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions