Skip to content

[BUG] Unsupported image MIME blocks can cross the Codex request boundary #1101

Description

@Frzzek

Problem (one or two sentences)

Codex request formatting can forward a base64 image block whose declared media type is outside the provider-safe image set. The same class of visual input can originate from read_file, causing unsupported encoded image data to enter persisted tool content before the provider rejects it.

Context (who is affected and when)

This affects image-capable Codex sessions that encounter visual files whose extensions map to formats such as ICO, SVG, BMP, TIFF, or AVIF. The reproduction uses generated fixture bytes only.

Reproduction steps

  1. Construct a synthetic Anthropic-style image block with source type base64, media type image/x-icon, and bytes generated from a fixed fixture label.
  2. Pass the block through the OpenAI Codex conversation formatter.
  3. Observe that the unpatched formatter emits an input_image data URL with the unsupported media type.
  4. Read a synthetic .ico or text .svg through read_file with an image-capable model.
  5. Observe that the unpatched ingestion path can classify the file as an image and produce encoded image content.

Expected result

Only JPEG, PNG, GIF, and WebP become model image blocks. Unsupported or malformed image inputs become deterministic text metadata that contains no image bytes or remote URL. read_file returns metadata only for unsupported visual formats and never creates an encoded image block for them.

Actual result

Unsupported image media types can cross the Codex request boundary, and unsupported visual files can be converted to encoded image content during read_file ingestion.

Variations tried (optional)

A focused regression covers JPEG, PNG, GIF, and WebP allowlisting; ICO, SVG, BMP, TIFF, and AVIF omission; malformed encoded data; URL image sources; binary ICO ingestion; and text SVG ingestion.

App Version

3.74.0 source baseline

API Provider (optional)

OpenAI (Codex)

Model Used (optional)

Image-capable Codex model

Zoo Code Task Links (optional)

None. No task records or conversation exports are included.

Relevant logs or errors (optional)

None. The reproduction is a standalone synthetic unit-test harness.

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