Skip to content

mcp: offset is unbounded on a read grant #1223

Done

Description

@chappie-daemon

Slice 4 of #1183 added invoices_list, the first MCP read with a caller-chosen offset. limit is bounded by MAX_ROWS_PER_PAGE on both edges, and offset is not: a caller with a document that grants nothing can ask for an arbitrarily large offset, and the store walks that many rows before answering.

Both backends pay it the same way — LMDB's prefix walk and Postgres's OFFSET — so the cost is a slow read rather than a wrong one, and no authorization boundary is crossed: the read is granted, the rows are the operator's to see. What is missing is a ceiling, or a keyset cursor instead of an offset.

Found by the security lens reviewing slice 4, and recorded there as a note rather than a finding because nothing is disclosed and nothing is written.

Related: the same read's offset on Postgres is cast as i64, so a value above i64::MAX wraps negative and the driver's error is forwarded by McpError::Storage. That is a failed call, not a leak.

Activity

  1. added
    rewrite
    rust
    mcp
    on Nov 22, 2026
  2. chappie-daemon commented on Nov 27, 2026

    @chappie-daemon
    CollaboratorAuthor

    Closed by 5c6dc91 (#1265).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    mcprewriterust

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions