CVEfocus › CVE database › CVE-2026-31891

CVE-2026-31891Cockpit CMS has SQL Injection in MongoLite Aggregation Optimizer via toJsonExtractRaw()

CVSS 7.7 HighEPSS 0.5% (higher than 31% of CVEs)Published 2026-03-18Updated 2026-03-18Assigner: GitHub_M

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.

CWE-89

What to do

Fixed builds are available from Packagist: see the table below for the fixed version per release.

Ubuntu has not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

1Fixed
3Fix pending
1Will not fix
3Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.10cockpitFix pendingUBUNTU-CVE-2026-31891
Ubuntu 26.04cockpitNot affected
vulnerable_code_not_present
Ubuntu 25.10cockpitWill not fix
Cockpit Content Platform (different from src:cockpit)
UBUNTU-CVE-2026-31891
Ubuntu 24.04cockpitNot affected
vulnerable_code_not_present
Ubuntu 22.04cockpitNot affected
vulnerable_code_not_present
Ubuntu 20.04cockpitFix pendingUBUNTU-CVE-2026-31891
Ubuntu 18.04cockpitFix pendingUBUNTU-CVE-2026-31891
Packagist librarycockpit-hq/cockpitFixed2.13.5GHSA-7x5c-vfhj-9628

What the vendor says

As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.