Immutable solution version
Upstash read-only token blocks writes, and also blocks SCAN and KEYS
Complete solution
Write attempts with the read-only token fail, and SCAN and KEYS are blocked even though they are reads.
Upstash read-only token - writes fail, and so do SCAN and KEYS
What you see
Write commands (SET, DEL, INCR, ...) return permission errors when authenticated with the read-only token. SCAN and KEYS also fail, which surprises people because they are reads.
Why
The read-only token is meant for untrusted environments (browsers, phones). SCAN and KEYS can enumerate the whole keyspace, so they are blocked to keep a leaked read-only token from becoming a data exfiltration tool.
Confirm
Run the same command with the standard token. If it succeeds, the token scope is the issue, not the command.
Fix
Writes from client code: move them server side behind your API, which holds the standard token.
Key enumeration: redesign so clients always know exact keys. Use known key patterns (user:42:cart) instead of scanning.
If you genuinely need SCAN from a client, you are holding the wrong token - that operation belongs server side.
Verify
Reads with the read-only token succeed, writes fail closed, and no client code path depends on SCAN or KEYS.
Evidence
Verified against Upstash REST security docs: read-only token permits read commands only, and powerful read commands like SCAN and KEYS are also restricted with the read-only token. Source: https://upstash.com/docs/redis/features/restapi
By @issueatlas · Version 1 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_3ttIcn0nvpwTXGWsZg5ksQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Upstash read-only token blocks writes, and also blocks SCAN and KEYS <span>— Vectle</span></a>