{"id":"CVE-2026-49229","title":"@actual-app/sync-server: Disabled OpenID users keep access through existing session tokens","summary":"@actual-app/sync-server: Disabled OpenID users keep access through existing session tokens","severity":"high","cvss":8.3,"cwe":["CWE-613"],"vendor":"actual-app","product":"@actual-app/sync-server","ecosystem":"npm","affected":["@actual-app/sync-server <= 26.5.2"],"patched":["@actual-app/sync-server 26.6.0"],"published":"2026-06-22","updated":"2026-06-22","source":"GHSA","sourceUrl":"https://github.com/advisories/GHSA-cq9c-6w48-qmfg","references":[{"url":"https://github.com/actualbudget/actual/security/advisories/GHSA-cq9c-6w48-qmfg"},{"url":"https://github.com/advisories/GHSA-cq9c-6w48-qmfg"}],"tags":["ghsa","npm"],"ingestedAt":"2026-06-29T13:24:35.488Z","epss":0.00441,"epssPercentile":0.37754,"slug":"CVE-2026-49229","body":"## Overview\n\n### Summary\n\nIn OpenID multi-user mode, disabling a user only blocks future OpenID login for that identity. Existing Actual session tokens for the disabled user remain valid, so the user can continue calling authenticated server endpoints after an administrator has disabled the account.\n\n### Details\n\nThe disabled-user check is present during OpenID login finalization. Existing users are only accepted when the matching row has `enabled = 1`, and a disabled row causes the OpenID grant to fail before a new session token is created.\n\n```ts\n// packages/sync-server/src/accounts/openid.ts:284-291\nconst { id: userIdFromDb, display_name: displayName } =\n  accountDb.first(\n    'SELECT id, display_name FROM users WHERE user_name = ? and enabled = 1',\n    [identity],\n  ) || {};\n\nif (userIdFromDb == null) {\n  throw new Error('openid-grant-failed');\n}\n```\n\nThe shared session validation path does not perform the same enabled-user check. It accepts any existing token row that has not expired, then returns the session object to every route protected by `validateSessionMiddleware`.\n\n```ts\n// packages/sync-server/src/util/validate-user.ts:10-41\nexport function validateSession(req: Request, res: Response) {\n  let { token } = req.body || {};\n  if (!token) {\n    token = req.headers['x-actual-token'];\n  }\n\n  const session = getSession(token);\n  ...\n  return session;\n}\n```\n\nThis means account disablement and session authorization diverge:\n\n```text\nOpenID login path: users.enabled must be 1\nExisting session path: token exists and is not expired; users.enabled is not checked\n```\n\nThe default token expiration setting is `never`, so this is not just a short race after disablement on default deployments.\n\n```js\n// packages/sync-server/src/load-config.js:260-264\ntoken_expiration: {\n  doc: 'Token expiration time.',\n  format: 'tokenExpiration',\n  default: 'never',\n  env: 'ACTUAL_TOKEN_EXPIRATION',\n},\n```\n\nAdmins can change a user's enabled state through the user update route, but that update does not delete the user's existing sessions. After the update, the old token still satisfies `validateSession`.\n\n```js\n// packages/sync-server/src/app-admin.js:91-101\napp.patch('/users', validateSessionMiddleware, async (req, res) => {\n  if (!isAdmin(res.locals.user_id)) {\n    ...\n  }\n\n  const { id, userName, role, displayName, enabled } = req.body || {};\n```\n\n```ts\n// packages/sync-server/src/services/user-service.ts:98-102\ngetAccountDb().mutate(\n  'UPDATE users SET user_name = ?, display_name = ?, enabled = ?, role = ? WHERE id = ?',\n  [userName, displayName, enabled, roleId, userId],\n);\n```\n\nAuthenticated server features then continue to trust that session. For example, the sync API installs `validateSessionMiddleware` for the whole router, so a disabled user can keep using any sync operation that their still-valid session and existing file ownership/access allow.\n\n```ts\n// packages/sync-server/src/app-sync.ts:37-39\nconst app = express();\napp.use(validateSessionMiddleware);\napp.use(errorMiddleware);\n```\n\nThis is distinct from the previously published cross-user sync authorization issue: the attacker does not need to access another user's file ID. The bypass is that a disabled user's own session remains authorized after account disablement.\n\n### PoC\n\n1. Run an Actual Sync Server in OpenID multi-user mode with `@actual-app/sync-server` 26.5.0. Use the default token expiration setting, or any setting where the token has not expired yet.\n2. Log in as a non-admin OpenID user and save the returned Actual session token.\n3. As an admin, disable that same user through `PATCH /admin/users` by sending `enabled: false`.\n4. Reuse the old token against a protected endpoint.\n\nExample success check:\n\n```bash\ncurl -s https://actual.example.com/account/validate \\\n  -H 'X-Actual-Token: <disabled_user_existing_token>'\n```\n\nExpected result on the affected code path: the request is still treated as authenticated and returns the disabled user's account/session information instead of `401` or `403`.\n\nA sync-facing check uses the same session validation primitive:\n\n```bash\ncurl -s https://actual.example.com/sync/list-user-files \\\n  -H 'X-Actual-Token: <disabled_user_existing_token>'\n```\n\nExpected result on the affected code path: the disabled user can still list and operate on budget files that the stale session is otherwise allowed to access.\n\n### Impact\n\nA disabled OpenID user can keep post-authentication access until the session row is deleted or expires. With the default `token_expiration: never`, this can persist indefinitely.\n\nFor a disabled basic user, the confirmed impact is continued access to that user's own budgets and any budgets shared with that user, including sensitive financial data and allowed mutations. For a disabled admin user, the impact is broader because the existing token can still satisfy admin role checks; that condition preserves administrative access after the account was disabled.\n\nThe missing rule is that session validation should reject disabled users, and disabling or deleting a user should revoke that user's existing sessions.\n\n## Affected packages\n\n- `@actual-app/sync-server <= 26.5.2`\n\n## Remediation\n\nUpgrade to a patched release:\n\n- `@actual-app/sync-server 26.6.0`","depth":"twilight","depthScore":46,"depthScoreParts":{"impact":45.7,"likelihood":0.1,"exploitation":0,"ransomware":0},"changes":[]}