Pagination documentation definitions are misaligned or misleading #3326
Replies: 1 comment
|
The spec's own answer here is narrower than "encrypted" — opacity is a client-side contract, not a server-side security requirement. From the pagination spec:
There's no MUST/SHOULD anywhere about the server signing or encrypting the cursor — the spec's own example ( Where it becomes a real concern is the scenario you and the pagination proposal both gesture at: if the server trusts an unsigned cursor's offset/filter fields without re-deriving or re-validating them against the current request, a client can hand-construct or replay a cursor to jump to a page it shouldn't reach — past a permission-filtered boundary, or against a different tool/argument set than the one that issued it. That's not a violation of the pagination spec (the client never parsed anything), it's a server-side trust bug — same class as IDOR-via-pagination-token seen plenty in REST APIs. HMAC/signing the cursor to the params that produced it, plus a TTL, is the right fix for that — but it's server-side hygiene the spec is silent on, not something "opaque" currently requires. |
Uh oh!
There was an error while loading. Please reload this page.
Pagination documentation definitions are misaligned or misleading
The MCP server uses "opaque tokens" as cursor in pagination.
But then I see all MCP implementations just using base64 encoded JSON objects of the pagination limit and offset or page number as "opaque token".
Storing such a key on the server doesn't really fit the stateless model of the Modern era MCP server (
2026-07-28).If you want to bring it more in line with de definition of an opaque token, you might want to do something like encrypting the JSON object with a Pepper (server secret) and Salt it with the primitive tool name (
tools/list) andnow()+ttlMstimestamp before base64 encoding it.This should prevent someone (somewhat) from creating their own cursor pointers or reusing them.
(I'm not a crypto expert)
My question is: How opaque or secret does the pagination cursor have to be?
All reactions