CVE-2026-31891: CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') in Cockpit-HQ Cockpit
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.
AI Analysis
Technical Summary
Cockpit CMS is a headless content management system that uses a MongoLite-based aggregation mechanism to query content stored in an SQLite database. Versions 2.13.4 and earlier contain a SQL Injection vulnerability (CWE-89) in the MongoLite Aggregation Optimizer component. Specifically, the vulnerability arises from improper sanitization of field names used in aggregation queries submitted via the /api/content/aggregate/{model} REST API endpoint. Attackers possessing a valid read-only API key, which is the lowest privilege level, can craft aggregation queries with maliciously crafted field names that inject arbitrary SQL commands. This injection allows bypassing the _state=1 filter that normally restricts queries to published content, thereby exposing unpublished or restricted content. The injection vector targets the toJsonExtractRaw() method in lib/MongoLite/Aggregation/Optimizer.php, which did not sanitize field names properly, unlike the toJsonPath() method which was sanitized starting in version 2.13.3. The vulnerability affects any deployment where the aggregation API endpoint is accessible to untrusted users, including public internet exposure or insufficient network segmentation. The vulnerability was patched in version 2.13.5 by extending field-name sanitization to the vulnerable method, effectively closing the injection vector. The CVSS v3.1 base score is 7.7 (high), reflecting network attack vector, low attack complexity, required privileges of read-only API key, no user interaction, and high confidentiality impact with no integrity or availability impact. No public exploits have been reported to date.
Potential Impact
The primary impact of this vulnerability is unauthorized disclosure of sensitive content stored within Cockpit CMS instances. Attackers can bypass content publication filters to access unpublished drafts, restricted documents, or other sensitive data that should not be publicly accessible. This can lead to data leakage of intellectual property, internal communications, or user data, potentially causing reputational damage, regulatory compliance violations, and competitive disadvantage. Since exploitation requires only a read-only API key, which may be easier to obtain or guess than administrative credentials, the attack surface is significant. The vulnerability does not allow data modification or denial of service, but the confidentiality breach alone is critical. Organizations using Cockpit CMS in sectors such as media, publishing, government, or enterprises relying on content confidentiality are at heightened risk. Publicly exposed API endpoints or weak API key management practices exacerbate the risk. The lack of known exploits in the wild suggests limited active exploitation currently, but the vulnerability’s simplicity and severity warrant urgent remediation.
Mitigation Recommendations
Organizations should immediately upgrade all Cockpit CMS instances to version 2.13.5 or later, where the vulnerability is patched. If upgrading is not immediately feasible, restrict access to the /api/content/aggregate/{model} endpoint by implementing network-level controls such as IP whitelisting, VPN access, or firewall rules to limit API access to trusted users only. Review and rotate API keys regularly, especially read-only keys, to reduce the risk of key compromise. Implement strict API key management policies, including least privilege principles and monitoring for anomalous API usage patterns. Conduct thorough audits of API endpoint exposure and ensure that no untrusted or public users can access sensitive aggregation APIs. Consider deploying Web Application Firewalls (WAFs) with custom rules to detect and block suspicious aggregation query patterns or SQL injection attempts targeting the vulnerable endpoint. Finally, monitor vendor advisories and threat intelligence feeds for any emerging exploit attempts or proof-of-concept code related to this vulnerability.
Affected Countries
United States, Germany, United Kingdom, France, Canada, Australia, Netherlands, Japan, South Korea, India
CVE-2026-31891: CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') in Cockpit-HQ Cockpit
Description
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.
AI-Powered Analysis
Technical Analysis
Cockpit CMS is a headless content management system that uses a MongoLite-based aggregation mechanism to query content stored in an SQLite database. Versions 2.13.4 and earlier contain a SQL Injection vulnerability (CWE-89) in the MongoLite Aggregation Optimizer component. Specifically, the vulnerability arises from improper sanitization of field names used in aggregation queries submitted via the /api/content/aggregate/{model} REST API endpoint. Attackers possessing a valid read-only API key, which is the lowest privilege level, can craft aggregation queries with maliciously crafted field names that inject arbitrary SQL commands. This injection allows bypassing the _state=1 filter that normally restricts queries to published content, thereby exposing unpublished or restricted content. The injection vector targets the toJsonExtractRaw() method in lib/MongoLite/Aggregation/Optimizer.php, which did not sanitize field names properly, unlike the toJsonPath() method which was sanitized starting in version 2.13.3. The vulnerability affects any deployment where the aggregation API endpoint is accessible to untrusted users, including public internet exposure or insufficient network segmentation. The vulnerability was patched in version 2.13.5 by extending field-name sanitization to the vulnerable method, effectively closing the injection vector. The CVSS v3.1 base score is 7.7 (high), reflecting network attack vector, low attack complexity, required privileges of read-only API key, no user interaction, and high confidentiality impact with no integrity or availability impact. No public exploits have been reported to date.
Potential Impact
The primary impact of this vulnerability is unauthorized disclosure of sensitive content stored within Cockpit CMS instances. Attackers can bypass content publication filters to access unpublished drafts, restricted documents, or other sensitive data that should not be publicly accessible. This can lead to data leakage of intellectual property, internal communications, or user data, potentially causing reputational damage, regulatory compliance violations, and competitive disadvantage. Since exploitation requires only a read-only API key, which may be easier to obtain or guess than administrative credentials, the attack surface is significant. The vulnerability does not allow data modification or denial of service, but the confidentiality breach alone is critical. Organizations using Cockpit CMS in sectors such as media, publishing, government, or enterprises relying on content confidentiality are at heightened risk. Publicly exposed API endpoints or weak API key management practices exacerbate the risk. The lack of known exploits in the wild suggests limited active exploitation currently, but the vulnerability’s simplicity and severity warrant urgent remediation.
Mitigation Recommendations
Organizations should immediately upgrade all Cockpit CMS instances to version 2.13.5 or later, where the vulnerability is patched. If upgrading is not immediately feasible, restrict access to the /api/content/aggregate/{model} endpoint by implementing network-level controls such as IP whitelisting, VPN access, or firewall rules to limit API access to trusted users only. Review and rotate API keys regularly, especially read-only keys, to reduce the risk of key compromise. Implement strict API key management policies, including least privilege principles and monitoring for anomalous API usage patterns. Conduct thorough audits of API endpoint exposure and ensure that no untrusted or public users can access sensitive aggregation APIs. Consider deploying Web Application Firewalls (WAFs) with custom rules to detect and block suspicious aggregation query patterns or SQL injection attempts targeting the vulnerable endpoint. Finally, monitor vendor advisories and threat intelligence feeds for any emerging exploit attempts or proof-of-concept code related to this vulnerability.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-03-09T21:59:02.687Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 69ba1bd6771bdb17491a1d57
Added to database: 3/18/2026, 3:28:22 AM
Last enriched: 3/18/2026, 3:43:21 AM
Last updated: 3/19/2026, 4:01:01 AM
Views: 13
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.