CVE-2026-126658: ByteStash API keys bypass account deactivation in versions before 1.6.2

ByteStash versions 1.5.10 through 1.6.1 fail to revoke API keys when administrators deactivate user accounts, leaving snippet data and MCP tools accessible.

Christopher Ort
By Christopher Ort · 2 min read
Share
A server room with a single red warning light illuminated above a row of dark equipment racks
Image: AI-generated, i10X
On this page
  1. Quick Take
  2. In plain English
  3. What happened
  4. What you should do
  5. What it means
  6. Sources
i10X Quick Take

Quick Take

  1. What: ByteStash 1.5.10 through 1.6.1 do not check account status when validating API keys, so deactivated users retain full API access.
  2. Who is affected: Self-hosted ByteStash instances running versions 1.5.10 through 1.6.1 where administrators deactivate user accounts but expect API keys to stop working.
  3. What to do: Upgrade to ByteStash 1.6.2 immediately. The release notes describe this as a security patch requiring immediate update.
  4. Severity: Medium (CVSS 5.3). Attackers need a valid API key from a deactivated account.
  5. Fixed in: Version 1.6.2, released November 10, 2026.

In plain English

ByteStash is a self-hosted tool for storing code snippets. When an administrator deactivates a user account, the web login stops working, but any API keys that user created keep working. That means a deactivated user (or anyone who has their key) can still read, create, change, and delete all the snippets in that account. Version 1.6.2 fixes this by adding a single check to the database query.

What you should do: If you run ByteStash, install 1.6.2 now; if you only use code snippet tools as a regular user and do not host your own ByteStash server, you can ignore this.

What happened

ByteStash introduced API key authentication in version 1.5.4. The validateApiKey function in apiKeyRepository.js joins the api_keys and users tables but only checks whether the key itself is active (ak.is_active = 1). It never checks the users.is_active column. When an administrator deactivates a user via the PATCH /api/admin/users/:id/toggle-active endpoint, the system sets users.is_active to 0 but leaves all the user’s API keys in the database with is_active = 1. The JWT authentication path does enforce the account status check (in middleware/auth.js line 124), so web login correctly returns 403 for deactivated accounts. API key requests, however, short-circuit that middleware and go straight to validateApiKey, which has no equivalent check.

The GitHub security advisory GHSA-26m9-ww2j-3cr5 includes a proof of concept showing that after deactivation, a victim’s API key can still call GET /api/snippets, POST /api/snippets, DELETE /api/snippets/:id, and POST /mcp with full MCP tool access, while the same user’s JWT token correctly returns 403. The advisory notes that deleting a user does revoke keys (because the JOIN returns no row), but deactivation, the everyday offboarding action, does not.

What you should do

Upgrade to ByteStash 1.6.2. The release notes on GitHub state “This version introduces a couple of security patches, update immediately.” The fix adds AND u.is_active = 1 to the WHERE clause in validateApiKey (commit eb4ecdf) and also revokes all API keys when an administrator deactivates an account, so reactivation does not silently restore access to keys that may have leaked.

What it means

Account deactivation is a standard administrative control for offboarding users or responding to suspected compromise. When that control silently fails, administrators lose a key security boundary. In ByteStash, the gap existed for 18 months (version 1.5.4 through 1.6.1) and affected every installation that relied on deactivation to cut off access. The vulnerability requires an attacker to hold a valid API key, so the risk is highest in scenarios where keys were shared, logged, or exfiltrated before deactivation. The CVSS score of 5.3 reflects medium severity because the attacker needs low privileges (a valid key) but no user interaction, and the impact is limited to confidentiality and integrity of the deactivated account’s snippets, not the entire system.

Sources

Christopher Ort

Christopher Ort

Christopher Ort handles SEO, AI agent workflows and PR & partnerships at i10x.ai, the all-in-one AI workspace built by i10X Global Pte. Ltd. in Singapore. He is a graduate of Friedrich-Alexander-Universität Erlangen-Nürnberg (FAU). He is the author of “The Style Penalty”, a study published on SSRN that analyses 1,576 evaluation decisions by four frontier AI models to show how AI-written CVs fare in automated hiring screens; the research has been covered by heise online and t3n.

Editor's picks

  1. CVE-2026-126776: SiYuan MCP Tools Path Traversal Lets Attackers Write Files Outside Import Directory on Windows
  2. CVE-2026-126658: ByteStash API keys bypass account deactivation in versions before 1.6.2
  3. CVE-2026-125322: pgEdge Postgres MCP Server SQL injection in count_rows where parameter
  4. CVE-2026-68905: Hugo Blog AI Proxy Exposes API Keys Without Authentication
  5. CVE-2026-125321: pgEdge Postgres MCP Server login rate limiting bypassed via X-Forwarded-For