CVE-2026-31891
Cockpit CMS has SQL Injection in MongoLite Aggregation Optimizer via toJsonExtractRaw()
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- Low
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- None
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
7.7
Cockpit CMS has SQL Injection in MongoLite Aggregation Optimizer via toJsonExtractRaw()
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.
- Record
CVE-2026-31891- CVSS 3.1
- 7.7 High
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N - Weakness
- CWE-89
- Updated
- 2026-11-02
EUVDEUVD-2026-12751
7.7
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.
- Record
EUVD-2026-12751- CVSS 3.1
- 7.7 High
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-7x5c-vfhj-9628
7.7
Cockpit CMS has SQL Injection in MongoLite Aggregation Optimizer via toJsonExtractRaw()
Impact
This is a SQL Injection vulnerability in the MongoLite Aggregation Optimizer.
Any Cockpit CMS instance running version 2.13.4 or earlier with API access enabled is potentially affected.
Who is impacted:
- Any deployment where the
/api/content/aggregate/{model}endpoint is publicly accessible or reachable by untrusted users. - Attackers in possession of a valid read-only API key (the lowest privilege level) can exploit this vulnerability — no admin access is required.
What an attacker can do:
- Inject arbitrary SQL via unsanitized field names in aggregation queries.
- Bypass the
_state=1published-content filter to access unpublished or restricted content. - Extract unauthorized data from the underlying SQLite content database.
Confidentiality impact is High. Integrity and availability are not directly affected by this vulnerability.
Patches
This vulnerability has been patched in version 2.13.5.
All users running Cockpit CMS version 2.13.4 or earlier are strongly advised to upgrade to 2.13.5 or later immediately.
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.
- Record
GHSA-7x5c-vfhj-9628- CVSS 3.1
- 7.7 High
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N - Weakness
- CWE-89
- Updated
- 2026-11-02
NVD
7.7
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.
- Record
CVE-2026-31891- CVSS 3.1
- 7.7 High
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N - CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-89
- Updated
- 2026-11-02
OSV
7.7
Cockpit CMS has SQL Injection in MongoLite Aggregation Optimizer via toJsonExtractRaw()
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.
- Record
CVE-2026-31891- CVSS 3.1
- 7.7 High
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N - Weakness
- CWE-89
- Updated
- 2026-11-02
OSVGHSA-7x5c-vfhj-9628
7.7
Cockpit CMS has SQL Injection in MongoLite Aggregation Optimizer via toJsonExtractRaw()
Impact
This is a SQL Injection vulnerability in the MongoLite Aggregation Optimizer.
Any Cockpit CMS instance running version 2.13.4 or earlier with API access enabled is potentially affected.
Who is impacted:
- Any deployment where the
/api/content/aggregate/{model}endpoint is publicly accessible or reachable by untrusted users. - Attackers in possession of a valid read-only API key (the lowest privilege level) can exploit this vulnerability — no admin access is required.
What an attacker can do:
- Inject arbitrary SQL via unsanitized field names in aggregation queries.
- Bypass the
_state=1published-content filter to access unpublished or restricted content. - Extract unauthorized data from the underlying SQLite content database.
Confidentiality impact is High. Integrity and availability are not directly affected by this vulnerability.
Patches
This vulnerability has been patched in version 2.13.5.
All users running Cockpit CMS version 2.13.4 or earlier are strongly advised to upgrade to 2.13.5 or later immediately.
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.
- Record
GHSA-7x5c-vfhj-9628- CVSS 3.1
- 7.7 High
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N - Weakness
- CWE-89
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2026-31891
7.7
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.
- Record
UBUNTU-CVE-2026-31891- CVSS 3.1
- 7.7 High
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N - CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
cockpit-hq/cockpitPackagist |
before 2.13.5 | 2.13.5 |
cockpit-hq/cockpitPackagist |
before 2.13.5, plus listed versions 2.0.02.0.12.0.22.1.02.1.1 Show 45 moreShow less2.1.22.10.02.10.12.10.22.10.32.11.02.11.12.11.22.11.32.11.42.12.02.12.12.13.02.13.12.13.22.13.32.13.42.2.02.2.12.2.22.3.02.3.12.3.22.3.32.3.42.3.52.3.62.3.72.3.82.3.92.4.02.4.12.5.02.5.12.5.22.6.02.6.12.6.22.6.32.7.02.7.12.7.22.8.02.8.12.8.2 |
2.13.5 |
cockpitUbuntu:18.04:LTS |
All versions, plus listed versions 151-1156-1157-1158-1160-1 Show 4 moreShow less161-1162-1163-1164-1 |
None known |
cockpitUbuntu:20.04:LTS |
All versions, plus listed versions 202.1-1204-1206-1207-1208-1 Show 6 moreShow less210-1211-1212-1213-1214.1-1215-1 |
None known |
cockpitUbuntu:22.04:LTS |
All versions, plus listed versions 252-1256-1257-1258-1259-1 Show 6 moreShow less260-1261-1262-1263-1264-1264-1ubuntu0.22.04.1 |
None known |
cockpitUbuntu:24.04:LTS |
All versions, plus listed versions 300.1-1303-1304-1305-1306-1 Show 7 moreShow less307-1308-1309-1310.1-1311-1312-1build2314-1 |
None known |
cockpitUbuntu:25.10 |
All versions, plus listed versions 333-1337-1339-1342-1343-1345-1346-1 |
None known |
cockpitUbuntu:26.10 |
All versions, plus listed versions 360-1362-1365-1367-1 |
None known |
cockpitUbuntu:26.04:LTS |
All versions, plus listed versions 346-1348-1350-1352-1353.1-1 Show 4 moreShow less354-1355-1356-1360-1 |
None known |
Public exploits
Links only. Every CVE stores no exploit code.
| Source | Link | Date |
|---|---|---|
| PoC in GitHub | ffasterss/CVE-2026-31891 | 2026-03-19 |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV, PoC in GitHub |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-31891 is a high vulnerability (CVSS 7.7) in Agentejo Cockpit, published March 17, 2026. Public exploit code exists. EPSS puts the chance of exploitation in the next 30 days at 0.41%, the 35th percentile. Fixed in cockpit-hq/cockpit 2.13.5.
References
github.com/Cockpit-HQ/Cockpit/security/advisories/GHSA-7x5c-vfhj-9628
github.com/Cockpit-HQ/Cockpit/releases/tag/2.13.5
nvd.nist.gov/vuln/detail/CVE-2026-31891
github.com/advisories/GHSA-7x5c-vfhj-9628
github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31891.json
github.com/Cockpit-HQ/Cockpit
ubuntu.com/security/CVE-2026-31891
cve.org/CVERecord?id=CVE-2026-31891
Left out here: 9 versions. The JSON record has them.