anomalyco / anomalyco/opencode

Text data URLs with uppercase BASE64 markers expose encoded payloads

Open
#47,583 1 comment 0 reactions 1 assignee View on GitHub

@rekram1-node is already working on this.

Since Sep 6, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

Text attachments using an uppercase or mixed-case base64 flag are not decoded in the session prompt path. The shared data-URL helper checks for the exact lowercase substring ;base64; when it receives data:text/plain;BASE64,SGVsbG8=, it falls through to percent-decoding and returns the literal text SGVsbG8= instead of Hello.

The Fetch Standard's data-URL processor matches the base64 flag ASCII case-insensitively. The helper should parse semicolon-delimited metadata and recognize an exact base64 token without regard to casing.

Reference: https://fetch.spec.whatwg.org/#data-url-processor

This is distinct from #47538, which concerns uppercase DATA: schemes during V2 media normalization. This report concerns the BASE64 flag in server-side text attachment decoding.

Plugins

N/A

OpenCode version

N/A (reproduced in the shared data-URL helper)

Steps to reproduce
  1. Evaluate decodeDataUrl("data:text/plain;BASE64,SGVsbG8=").
  2. Observe that it returns SGVsbG8=.
  3. Repeat with the lowercase marker data:text/plain;base64,SGVsbG8= and observe that it returns Hello.

Expected behavior: both casing variants should return Hello.

Screenshot and/or share link

Not provided; the helper call above is the deterministic reproduction.

Operating System

All

Terminal

All

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.