Get a Demo

Let's Patch It!

Book a short call with one our specialists, we'll walk you through how Endor Patches work, and ask you a few questions about your environment (like your primary programming languages and repository management). We'll also send you an email right after you fill out the form, feel free to reply with any questions you have in advance!

CVE

CVE-2026-31891

Cockpit CMS has SQL Injection in MongoLite Aggregation Optimizer via toJsonExtractRaw()
Back to all
CVE

CVE-2026-31891

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=1 published-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.

  • https://github.com/Cockpit-HQ/Cockpit/releases/tag/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.

Package Versions Affected

Package Version
patch Availability
No items found.

Automatically patch vulnerabilities without upgrading

Fix Without Upgrading
Detect compatible fix
Apply safe remediation
Fix with a single pull request

CVSS Version

Severity
Base Score
CVSS Version
Score Vector
C
H
U
7.7
-
3.1
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N
C
H
U
0
-
3.1
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N
C
H
U
-

Related Resources

No items found.

References

https://github.com/Cockpit-HQ/Cockpit/security/advisories/GHSA-7x5c-vfhj-9628, https://nvd.nist.gov/vuln/detail/CVE-2026-31891, https://github.com/Cockpit-HQ/Cockpit, https://github.com/Cockpit-HQ/Cockpit/releases/tag/2.13.5

Severity

7.7

CVSS Score
0
10

Basic Information

Ecosystem
Base CVSS
7.7
EPSS Probability
0.00012%
EPSS Percentile
0.01657%
Introduced Version
0
Fix Available
2.13.5

Fix Critical Vulnerabilities Instantly

Secure your app without upgrading.
Fix Without Upgrading