Summary
Termix contains an authorization flaw in its host credential endpoint that can expose plaintext SSH or sudo passwords belonging to other users. An authenticated user with a valid JWT may be able to enumerate host identifiers and retrieve credentials when ownership checks are not consistently applied during credential resolution.
Affected context
The issue affects Termix deployments where authenticated users can access the host credential resolution endpoint and host records are identified by numeric IDs. Risk arises when the endpoint accepts a host identifier and credential field without ensuring that the requested host belongs to the authenticated user. Exposed credentials may provide access to systems managed through the Termix instance.
Exploit preconditions
- Attack surface: Authenticated web API endpoint for host credential retrieval
- Required access: A valid authenticated session or JWT
- Trigger point: A request to the host password endpoint using a host identifier and credential field
- Why exploitation is possible: Ownership enforcement is not consistently preserved during credential lookup, allowing a requester-scoped lookup failure to fall back to the host owner's context
- Additional condition: Host identifiers must be discoverable or enumerable sufficiently for unauthorized records to be queried
Why this happens
The vulnerability results from an authorization decision being separated from the final credential lookup. Although the requester is authenticated, the application does not reliably bind the requested host record to that user's ownership context before resolving sensitive fields.
This behavior maps primarily to CWE-639: Authorization Bypass Through User-Controlled Key, because a user-controlled numeric identifier can select another user's object. It also relates to CWE-285: Improper Authorization, since access to sensitive credentials is not consistently restricted according to ownership.
Potential impact
- An attacker may disclose other users' plaintext SSH passwords
- An attacker may obtain sudo credentials for managed systems
- Stolen credentials could enable unauthorized access to external servers
- An attacker could modify, disrupt, or control systems reachable with the disclosed credentials
- Compromised credentials could support lateral movement or persistence
General mitigation guidance
Mitigation generally focuses on enforcing authorization at the point where each sensitive object and field is resolved.
Common defensive patterns include:
- Bind every host lookup to the authenticated user's tenant, owner, or access-control context
- Deny access when ownership or delegated permissions cannot be proven
- Avoid fallback lookups that change security context after a requester-scoped lookup fails
- Use server-side authorization checks for each credential field, including SSH and sudo secrets
- Prefer opaque, non-sequential identifiers where practical, while treating identifier secrecy as non-authoritative
- Minimize plaintext credential exposure and apply least privilege to managed-system accounts
- Record and protect credential-access events, with rate limits and anomaly detection for repeated identifier queries
How teams detect issues like this
Detection can combine code analysis, authorization-focused review, and runtime monitoring.
Useful approaches include:
- Static analysis for database lookups that use request-controlled identifiers without an adjacent ownership or policy predicate
- Code review checks for fallback queries that omit tenant, owner, or permission filters
- Tests that attempt cross-user access to every sensitive host field, including password and sudoPassword
- API policy tests verifying that authentication alone does not grant object-level access
- Monitoring for sequential host-ID requests, repeated credential-field access, and unusual cross-account access patterns
- Automated security review tools or policy-as-code checks to identify missing object-level authorization

