Cockpit CMS has SQL Injection in MongoLite Aggregation Optimizer via toJsonExtractRaw()
Key facts
- Attack vector
- Network
- Privileges required
- Low
- User interaction
- None
- Attack complexity
- Low
- Impact type
- SQL injection
- Confidentiality · integrity · availability
- High · None · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-89.
Summary
Cockpit is a headless content management system. Any Cockpit CMS instance running version 2.13.4 or earlier with API access enabled is potentially affected by a a SQL Injection vulnerability in the MongoLite Aggregation Optimizer. Any deployment where the `/api/content/aggregate/{model}` endpoint is publicly accessible or reachable by untrusted users may be vulnerable, and attackers in possession of a valid read-only API key (the lowest privilege level) can exploit this vulnerability — no admin access is required. An attacker can inject arbitrary SQL via unsanitized field names in aggregation queries, bypass the `_state=1` published-content filter to access unpublished or restricted content, and extract unauthorized data from the underlying SQLite content database. This vulnerability has been patched in version 2.13.5. The fix applies the same field-name sanitization introduced in v2.13.3 for `toJsonPath()` to the `toJsonExtractRaw()` method in `lib/MongoLite/Aggregation/Optimizer.php`, closing the injection vector in the Aggregation Optimizer.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| cockpit-hq | Cockpit | before 2.13.5 | 2.13.5 | Patch available | CNA |
| — | cockpit-hq/cockpit (Packagist) | before 2.13.5 | 2.13.5 | Patch available | GHSA-7x5c-vfhj-9628 |
- Cockpit Vendorcockpit-hq Affected before 2.13.5 Fixed in 2.13.5 Patch available CNA
- cockpit-hq/cockpit (Packagist) Vendor— Affected before 2.13.5 Fixed in 2.13.5 Patch available GHSA-7x5c-vfhj-9628
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:agentejo:cockpit:*:*:*:*:*:*:*:* | before 2.13.5 | Vulnerable | cockpit-hq |
- cpe:2.3:a:agentejo:cockpit:*:*:*:*:*:*:*:* Versions before 2.13.5 Vulnerable ·cockpit-hq
Remediation
- Fix · CNA Cockpit (Cockpit-HQ) Fixed in 2.13.5
- Fix · GHSA-7x5c-vfhj-9628 cockpit-hq/cockpit (Packagist) Fixed in 2.13.5 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2026-31891
- 2026-10-03 Alias added: GHSA-7x5c-vfhj-9628
References
More cockpit-hq Cockpit vulnerabilities
- TI-2020-18291 Agentejo Cockpit before 0.11.2 allows NoSQL injection via the Controller/Auth.php resetpassword function. CVSS 3.1CRITICAL 9.8
- TI-2020-18290 Agentejo Cockpit before 0.11.2 allows NoSQL injection via the Controller/Auth.php check function. CVSS 3.1CRITICAL 9.8
- TI-2022-02511 Insufficient Session Expiration in cockpit-hq/cockpit CVSS 3.1CRITICAL 9.8
- TI-2020-18292 Agentejo Cockpit before 0.11.2 allows NoSQL injection via the Controller/Auth.php newpassword function. CVSS 3.1CRITICAL 9.8
- TI-2023-19207 A Cross-Site Request Forgery (CSRF) in the Admin portal of Cockpit CMS v2.5.2 allows… CVSS 3.1HIGH 8.8
- TI-2023-01240 Unrestricted Upload of File with Dangerous Type in cockpit-hq/cockpit CVSS 3.1HIGH 8.8
Sources
- CVE-2026-31891 · CVE Program
- CVE-2026-31891 · NVD
- FIRST EPSS
- GHSA-7x5c-vfhj-9628 · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences