Summary
OliveTin exposes predefined shell commands through a web interface and supports JWT-based authentication.
In affected versions, the configured JWT audience (authJwtAud) is not enforced, so any validly signed token is accepted regardless of its aud claim, allowing authentication with tokens meant for other services.
Affected context
This vulnerability appears in OliveTin deployments that:
- Expose the OliveTin web UI to users or other services, and
- Configure JWT authentication using either
authJwtPubKeyPath(RSA public key) orauthJwtHmacSecret(HMAC secret), and - Rely on
authJwtAudto restrict which tokens are valid for OliveTin.
In such environments, OliveTin treats any correctly signed JWT as valid even if the aud (audience) claim does not match the configured authJwtAud, weakening isolation between services that share a signing key.
Exploit preconditions
- Attack surface: OliveTin HTTP(S) interface where JWT-secured requests are accepted.
- Required access: Ability to obtain or mint a validly signed JWT from the same issuer used by OliveTin (e.g., another service, shared IdP, or shared signing key).
- Trigger point: Presentation of a correctly signed JWT whose
audclaim is intended for a different audience/service than OliveTin. - Why exploitation is possible: During JWT parsing, OliveTin verifies the signature but does not enforce that the
audclaim matches the configuredauthJwtAud, violating the intended audience restriction and allowing cross-audience token reuse.
Why this happens
The core issue is incomplete JWT validation logic: the implementation verifies the token signature but fails to enforce the configured audience claim.
This aligns with CWE-287: Improper Authentication, because the system treats any validly signed token as sufficient proof of authorization, without confirming it was issued for this specific service.
It is also related to CWE-345: Insufficient Verification of Data Authenticity, since only part of the token's semantics are validated (signature) while critical contextual constraints (audience) are ignored.
Abstractly, this represents an authentication pattern where cryptographic validity is checked, but contextual claims (like audience) are not bound to the relying party's configuration, enabling token misuse across services.
Potential impact
- Attackers may authenticate to OliveTin using JWTs that were issued for a different application or API.
- Users or services with tokens for another system could gain unintended access to OliveTin's command interface.
- Cross-service privilege escalation may occur in environments where multiple services share an identity provider or signing keys.
- Execution of predefined shell commands via the OliveTin interface by unauthorized principals, potentially impacting underlying systems, data, or infrastructure.
- Confusion and auditing blind spots due to tokens appearing valid even though they were never intended for OliveTin.
General mitigation guidance
Effective mitigation focuses on enforcing full JWT validation semantics and tightening trust boundaries around identity tokens:
- Treat the audience claim as mandatory and ensure it is compared against a configured, service-specific value before accepting a token.
- Use distinct signing keys or client IDs for OliveTin, separate from other services, to reduce the blast radius of token misuse.
- Validate additional contextual claims (e.g., issuer, expiration, and authorized party) to ensure tokens are scoped correctly to OliveTin.
- Apply least-privilege design: restrict which commands are exposed through OliveTin and map identities to minimal command sets.
- Prefer secure-by-default configuration where JWT validation, including audience and issuer checks, is enabled and cannot be easily misconfigured or disabled.
- Document and regularly review the identity and access model for OliveTin, especially in environments using a shared identity provider.
How teams detect issues like this
Organizations can identify this class of JWT validation issues using a combination of code analysis and runtime monitoring:
- Static analysis and code review:
- Look for JWT parsing/verification code where the signature is validated but the
audclaim is not checked against configuration. - Review authentication middleware to confirm that all critical claims (audience, issuer, expiry) are validated before establishing a user session.
- Use SAST or linters that specifically flag incomplete JWT validation patterns (e.g., missing audience verification).
- Configuration and policy checks:
- Enforce security policies requiring explicit audience lists for all services relying on JWTs.
- Periodically audit OliveTin and related services to confirm they use unique audience values and keys.
- Runtime monitoring and logging:
- Log JWT claim values (with care to avoid sensitive data leakage) when authentication is performed, especially
aud,iss, and subject identifiers. - Detect anomalies such as tokens with unexpected
audvalues being accepted, or tokens originally issued for other services appearing in OliveTin logs. - Automated review tools:
- Integrate security scanners into CI/CD that model JWT usage patterns and flag endpoints lacking full claim enforcement.

