anomalyco / anomalyco/opencode

Message pagination accepts malformed cursor characters

Open
#48,034 0 comments 0 reactions 1 assignee View on GitHub

@neriousy is already working on this.

Since Sep 8, 2026.

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

Description

Description

The message pagination endpoint accepts malformed Base64URL cursors. Appending an invalid character such as ! to a valid cursor still decodes to the original cursor and returns HTTP 200. Malformed cursors should return 400 InvalidCursorError, as session pagination already does.

Plugins

None

OpenCode version

Current dev at dff8fbc149

Steps to reproduce
  1. Request /api/session/:id/message?limit=1 and save cursor.next.
  2. Request the next page with cursor=<saved cursor>!.
  3. Observe HTTP 200 and the same page as the unmodified cursor.

Expected: HTTP 400 with InvalidCursorError.

Screenshot and/or share link

Not applicable

Operating System

Linux x86_64

Terminal

OpenCode CLI

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.