Unescaped binary response scrambles TUI, possible code injection #3893

Open
opened 2026-02-16 17:41:51 -05:00 by yindo · 1 comment
Owner

Originally created by @shakeelmohamed on GitHub (Dec 26, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

In plan mode, a prompt like analyze this image <URL> when <URL> does not contain a file extension appears to return a raw binary mess and can scramble the entire TUI.

With mixed results, some extreme hallucinations may also occur.

  • In a new session with the above prompt, unexpected Python code with Chinese characters have been printed in a long-running response for several minutes with no end in site. (edit: this single response ran for 24m 59s)
  • Another session began spewing some science-fiction narrative

I am hesitant to try this prompt in build mode because arbitary code execution seems likely.

Response when viewing a session like this by link in browser:

I see there was an issue fetching the image content. The URL appears to be a valid Unsplash image URL, but the fetch returned binary JPEG data instead of the expected markdown/text format. Let me try a different approach to analyze this image.

OpenCode version

v1.0.201, v1.0.203

Steps to reproduce

  1. New opencode session
  2. Switch to plan mode
  3. Enter this prompt. I have reproduced this bug with multiple URLs without a file extension.
analyze this image https://framerusercontent.com/images/qC0cuuQpKdCPD4vp677H00eV8LE.png?width=2200&height=1203

(edit: the following URL does not have this issue in today’s v1.0.203 release)

analyze this image https://images.unsplash.com/photo-1766445318570-1dc4bf3f5d79?w=900&auto=format&fit=crop&q=60&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxmZWF0dXJlZC1waG90b3MtZmVlZHwzfHx8ZW58MHx8fHx8
  1. Watch the runaway train.

Screenshot and/or share link

Image Image Image Image

Operating System

MacOS 14.8, Docker

Terminal

Ghostty v1.2.3

Originally created by @shakeelmohamed on GitHub (Dec 26, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description In plan mode, a prompt like `analyze this image <URL>` when `<URL>` does not contain a file extension appears to return a raw binary mess and can scramble the entire TUI. With mixed results, some extreme hallucinations may also occur. - In a new session with the above prompt, unexpected Python code with Chinese characters have been printed in a long-running response for several minutes with no end in site. (edit: this single response ran for 24m 59s) - Another session began spewing some science-fiction narrative I am hesitant to try this prompt in build mode because arbitary code execution seems likely. Response when viewing a session like this by link in browser: > I see there was an issue fetching the image content. The URL appears to be a valid Unsplash image URL, but the fetch returned binary JPEG data instead of the expected markdown/text format. Let me try a different approach to analyze this image. ### OpenCode version v1.0.201, v1.0.203 ### Steps to reproduce 1. New opencode session 2. Switch to plan mode 3. Enter this prompt. I have reproduced this bug with multiple URLs without a file extension. ``` analyze this image https://framerusercontent.com/images/qC0cuuQpKdCPD4vp677H00eV8LE.png?width=2200&height=1203 ``` (edit: the following URL does not have this issue in today’s v1.0.203 release) ``` analyze this image https://images.unsplash.com/photo-1766445318570-1dc4bf3f5d79?w=900&auto=format&fit=crop&q=60&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxmZWF0dXJlZC1waG90b3MtZmVlZHwzfHx8ZW58MHx8fHx8 ``` 4. Watch the runaway train. ### Screenshot and/or share link <img width="1130" height="1271" alt="Image" src="https://github.com/user-attachments/assets/5ccbbfdc-1cd1-423a-a376-16d12dcdb9c4" /> <img width="1130" height="1186" alt="Image" src="https://github.com/user-attachments/assets/1980c988-d464-48e7-a697-6a0348c42868" /> <img width="1130" height="1271" alt="Image" src="https://github.com/user-attachments/assets/10122f6a-73b1-4d9c-a411-bbd2d8837bea" /> <img width="1130" height="1271" alt="Image" src="https://github.com/user-attachments/assets/da4ab9c5-6ab6-47e8-ac33-b8b876d05c21" /> ### Operating System MacOS 14.8, Docker ### Terminal Ghostty v1.2.3
yindo added the opentuibugperf labels 2026-02-16 17:41:51 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 26, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #2762: Unusable scrambled TUI (similar TUI corruption issues)
  • #6119: TUI fails to render with raw ANSI output and critical memory leak (TUI rendering corruption)
  • #2843: Can't use on remote machine via SSH — issues with text rendering/layout (TUI rendering issues)
  • #2859: TUI not working well with emacs-libvterm (TUI compatibility issues)
  • #3816: Clipboard image paste fails with AI_DownloadError due to binary corruption (binary data handling)

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Dec 26, 2025): This issue might be a duplicate of existing issues. Please check: - #2762: Unusable scrambled TUI (similar TUI corruption issues) - #6119: TUI fails to render with raw ANSI output and critical memory leak (TUI rendering corruption) - #2843: Can't use on remote machine via SSH — issues with text rendering/layout (TUI rendering issues) - #2859: TUI not working well with emacs-libvterm (TUI compatibility issues) - #3816: Clipboard image paste fails with AI_DownloadError due to binary corruption (binary data handling) Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3893