Summary
Rucio can accept an SSH challenge nonce as an authentication token because the token validator does not distinguish the two token types. An unauthenticated attacker who can reach the relevant API endpoint may use this behavior to act as the requested account, potentially including an administrative account.
Affected context
The issue occurs in Rucio's authentication flow when SSH challenge nonces and authentication tokens are stored in the same token table, but validation does not distinguish their purposes. It affects deployments with the vulnerable authentication behavior where the SSH challenge endpoint is reachable; exploitation could permit access to other API endpoints as the account associated with the challenge.
Exploit preconditions
- Attack surface: Rucio API, including the SSH challenge token endpoint
- Required access: No prior authentication is required, but the API must be reachable
- Trigger point: Authentication-token validation on an API request
- Why exploitation is possible: The validator may treat a short-lived SSH challenge nonce as a valid authentication token without confirming its intended purpose
Why this happens
The underlying bug is a failure to distinguish credentials with different purposes. Because SSH challenge nonces and authentication tokens share a token table, validation that checks token presence or association without enforcing the token's type and intended use can accept a nonce as an authentication credential. This is an improper authentication weakness mapped to CWE-287.
Potential impact
- An attacker could impersonate an arbitrary account
- Unauthorized access to API endpoints could expose or alter protected data
- An attacker could perform privileged actions if an administrative account is impersonated
- Compromised access could affect scientific data management operations
General mitigation guidance
Defensive patterns focus on ensuring credentials are accepted only for their intended purpose:
- Use distinct token types or namespaces for SSH challenges and authentication credentials
- Validate token purpose, account binding, expiry, and other relevant claims before granting access
- Make authentication fail closed when a credential's type or intended use is ambiguous
- Limit the privileges available to accounts and services, and apply authorization checks to sensitive operations
- Reduce unnecessary exposure of authentication endpoints and monitor access to them
How teams detect issues like this
- Review authentication code for token lookups that do not validate credential type, purpose, or intended audience
- Use static analysis and code review checks to flag shared credential stores without explicit type checks
- Test that challenge credentials are rejected by ordinary authentication paths and that account binding is enforced
- Monitor for unusual API activity, including unexpected access to sensitive endpoints or administrative actions
- Apply policy checks that require explicit credential-purpose validation in authentication flows

