
Loading

Loading
We use strictly necessary cookies to run this site, and analytics cookies to understand how it's used. See our Privacy Policy for details.
A GitHub-reviewed security advisory, not necessarily under active exploitation the way our CISA KEV advisories are, but a real, disclosed vulnerability in an open-source dependency.
Affected packages
Vulnerable: <= 5.7.4
Details
REST cookie parsing turns authenticationToken=j:%7B%7D into {}. REST authentication passes that object to the XO token provider without requiring a string. The token collection treats {} as an unfiltered lookup and returns its first token; the provider authenticates as that token's owner if it is unexpired. The authenticated /rest/v0/users/me/authentication_tokens route then returns reusable login token IDs.
packages/xo-server/src/api/session.mjs, function signIn(credentials) has no params schema (unlike the deprecated signInWithToken, which declares token: { type: 'string' }), so credentials.token can be any JSON value.packages/xo-server/src/xo-mixins/authentication.mjs, token provider:
this.registerAuthenticationProvider(async ({ token: tokenId }, { ip } = {}) => {
if (!tokenId) return // {} is truthy → passes
const token = await app.getAuthenticationToken(tokenId)
...
return { bypassOtp: true, expiration: token.expiration, userId: token.user_id }
getAuthenticationToken(properties) explicitly accepts an object, and _getAuthenticationToken(id, properties) does this._tokens.first(properties ?? id).Collection#first(properties) -> _get(properties); in collection/redis.mjs, if (isEmpty(properties)) return redis.sMembers(prefix + '_ids')… → all tokens. Non-empty objects on indexed fields (user_id, client_id) do an index lookup → token of the chosen user.index.mjs (req.cookies.token → isValidAuthenticationToken), xo-mixins/rest-api.mjs and @xen-orchestra/rest-api middleware (cookies.authenticationToken ?? cookies.token → authenticateUser({ token })). cookie-parser turns j:-prefixed cookie values into parsed JSON, so authenticationToken=j:{} yields {}.The object cookie returned 200 with unexpired token IDs, and one ID worked on a fresh request as an admin account. The attacker does not choose which token the empty-object lookup returns. Authentication succeeds only if the token returned first is unexpired and belongs to an existing user; if it is expired or its user was deleted, the request fails without trying another token.
curl -b 'authenticationToken=j:{}' https://<ip>/rest/v0/users
An adversary can bypass authentication and perform actions with 'Admin' privilege. Xen Orchestra compromise can lead to arbitrary code execution on managed pools and a full XCP-ng node takeover as root.
More npm advisories
Talk to us about this
Find out whether this dependency (or others like it) is actually reachable in your codebase.
Get help patching, or building dependency-scanning into your pipeline going forward.
A secure code review or supply chain review finds this before an advisory does.