Skip to main content

PHP CVE-2026-31891

HIGH
SQL Injection (CWE-89)
2026-03-17 https://github.com/Cockpit-HQ/Cockpit GHSA-7x5c-vfhj-9628
7.7
CVSS 3.1 · GitHub Advisory
View

Attack ChainAIDerived

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

  1. Access
    Obtain valid read-only API key
  2. Exploit
    Send crafted aggregation request to /api/content/aggregate/{model}
  3. Execution
    Inject SQL via unsanitized field names
  4. Impact
    Extract sensitive data from database

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Parameterized queries, prepared statements
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Persistence

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Cockpit CMS version 2.13.4 or earlier with API access enabled and /api/content/aggregate/{model} endpoint accessible. Attacker requires valid read-only API key (lowest privilege level). MongoLite Aggregation Optimizer processes unsanitized field names.

Impact

The CVSS 3.1 score of 7.7 (High) reflects network-based exploitation (AV:N) with low complexity (AC:L) requiring only low privileges (PR:L), specifically a read-only API key. The changed scope (S:C) indicates potential impact beyond the vulnerable component, though only confidentiality is affected (C:H, I:N, A:N). Without EPSS data or KEV listing, real-world exploitation likelihood remains theoretical, but the low barrier to entry (read-only API key) and straightforward attack vector make this a genuine priority for internet-exposed Cockpit instances. The vulnerability aligns with SSVC's 'attend' decision given its automatable nature, network accessibility, and high technical impact on data confidentiality.

Exploit ScenarioDerived

An attacker obtains a read-only API key through social engineering or by finding it in exposed configuration files, then sends crafted requests to the /api/content/aggregate/{model} endpoint with malicious field names containing SQL injection payloads. This allows the attacker to bypass content filters and extract sensitive unpublished data from the SQLite database, potentially exposing draft content, user information, or other confidential data stored in the CMS. The attack requires no user interaction and can be automated to extract large amounts of data remotely.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.0% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Mar 17, 2026

SQL injection in Cockpit CMS version 2.13.4 and earlier allows attackers with a valid read-only API key to inject arbitrary SQL through the /api/content/aggregate/{model} endpoint and extract unauthorized data from the SQLite database, including unpublished content. The vulnerability requires network access and low-privilege API credentials, enabling data exfiltration without administrative privileges. No patch is currently available.

Earlier versions of this analysis (1)
v1 Mar 17, 2026 - 20:30 CVSS 7.7

A SQL injection vulnerability exists in the MongoLite Aggregation Optimizer of Cockpit CMS versions 2.13.4 and earlier, allowing attackers with read-only API access to inject arbitrary SQL through unsanitized field names in aggregation queries. The vulnerability enables unauthorized data extraction from the SQLite content database, including access to unpublished content, posing a high confidentiality risk. No active exploitation has been reported (not in KEV), and no EPSS score is available, though the low attack complexity and remote exploitability make this a priority for exposed installations.

RemediationAI

Immediately upgrade Cockpit CMS to version 2.13.5 or later, which applies proper field-name sanitization to the toJsonExtractRaw() method (see release at https://github.com/Cockpit-HQ/Cockpit/releases/tag/2.13.5). For installations that cannot immediately upgrade, consider temporarily restricting access to the /api/content/aggregate/{model} endpoint through web server configuration or firewall rules, limiting API access to trusted IP addresses only. Review and rotate any API keys that may have been exposed, as even read-only keys can be used to exploit this vulnerability.

Affected Packages

composer cockpit-hq/cockpit fix: 2.13.5

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in composer

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

Technical ContextAI · show details

The vulnerability affects Cockpit CMS (CPE: pkg:composer/cockpit-hq_cockpit), specifically in the MongoLite Aggregation Optimizer component at the /api/content/aggregate/{model} endpoint. As classified under CWE-89 (Improper Neutralization of Special Elements used in an SQL Command), the flaw stems from inadequate input sanitization in the toJsonExtractRaw() method within lib/MongoLite/Aggregation/Optimizer.php, where field names are not properly sanitized before being incorporated into SQL queries. MongoLite is Cockpit's embedded database abstraction layer that translates MongoDB-style queries to SQLite operations, and the vulnerability allows injection at this translation layer.

Know when PHP gets its next vulnerability

  • 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

GitHub Advisory PRIMARY 7.7 HIGH
AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N

Primary rating from GitHub Advisory · only source for this CVE.

CVSS VectorGitHub Advisory

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

Lifecycle Timeline

2
Patch released
Mar 31, 2026 - 21:13 nvd
Patch available
CVE Published
Mar 17, 2026 - 17:07 nvd
HIGH 7.7

DescriptionGitHub Advisory

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.

Executive ViewAI

Why It Matters

A SQL injection vulnerability in Cockpit CMS versions 2.13.4 and earlier allows attackers with read-only API access to extract sensitive data from the content database, including unpublished materials. Organizations running affected versions face confidentiality risk, particularly if the CMS is internet-facing or accessible to untrusted users.

Business Impact: High
Compensating Controls

Implement network segmentation to restrict API access to authorized internal users only; deploy WAF rules to block common SQL injection patterns in aggregation query parameters; disable public API access if not required; apply API rate limiting and request filtering; monitor aggregation query logs for suspicious field name patterns; consider air-gapping the CMS from production until patch is available.

Threat Intelligence Overview

EPSS Score
0.0%
Top 93% exploitable
Data Quality
5 sources
Confidence: Medium

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 HIGH
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.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
High

Priority Score

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

Attack Technique

SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.

Affected Products (CPE)GitHub Advisory

pkg:composer/cockpit-hq_cockpit

Related Vulnerabilities in Cockpit CMS API SQL Injection

View all 2

More in PHP

View all
CVE-2019-11043 CRITICAL POC
9.8 Oct 28

In PHP versions 7.1.x below 7.1.33, 7.2.x below 7.2.24 and 7.3.x below 7.3.11 in certain configurations of FPM setup it

CVE-2012-1823 CRITICAL POC
9.8 May 11

sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not

CVE-2016-1555 CRITICAL POC
9.8 Apr 21

(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear

CVE-2018-11138 CRITICAL POC
9.8 May 31

The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by

CVE-2024-11680 CRITICAL POC
9.8 Nov 26

ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C

CVE-2025-49113 CRITICAL POC
9.9 Jun 02

Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au

CVE-2017-9841 CRITICAL POC
9.8 Jun 27

Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c

CVE-2025-0108 HIGH POC
8.8 Feb 12

Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers

CVE-2021-25298 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2021-25296 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2013-4983 CRITICAL POC
10.0 Sep 10

The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows

CVE-2023-6553 CRITICAL POC
9.8 Dec 15

The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1

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