DEV Community

CVE Reports
CVE Reports

Posted on Originally published at cvereports.com

CVE-2026-77378: CVE-2026-77378: Authenticated SQL Injection in Bolt CMS ListFormatHelper

CVE-2026-77378: Authenticated SQL Injection in Bolt CMS ListFormatHelper

Vulnerability ID: CVE-2026-77378
CVSS Score: 6.5
Published: 2026-11-20

CVE-2026-77378 (GHSA-r7h9-qx4h-77j5) is an authenticated SQL injection vulnerability affecting the bolt/core package of Bolt CMS in versions prior to 6.1.4. The flaw resides in the ListFormatHelper utility class, where content-type slugs are dynamically interpolated into raw SQL query strings via sprintf rather than bound as parameterized inputs. When the general/caching/list_format configuration directive is enabled, an authenticated user with upload privileges can exploit the /async/select-options endpoint to inject arbitrary SQL commands and query the underlying database.

TL;DR

Bolt CMS versions prior to 6.1.4 contain an authenticated SQL injection vulnerability in src/Utils/ListFormatHelper.php. Unsanitized content-type slugs are concatenated directly into raw SQL queries in the getSelect(), getRelated(), and getMenuLinks() methods. Authenticated attackers with upload permissions can exploit this via the /async/select-options endpoint when list_format caching is active. Upgrading to Bolt Core 6.1.4 resolves the issue by replacing string interpolation with Doctrine DBAL parameterized queries.


⚠️ Exploit Status: POC

Technical Details

  • CVE ID: CVE-2026-77378 (GHSA-r7h9-qx4h-77j5)
  • Vulnerability Class: CWE-89: SQL Injection
  • Affected Component: bolt/core (src/Utils/ListFormatHelper.php)
  • CVSS v3.1 Score: 6.5 Medium (CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:N/I:H/A:L)
  • Attack Vector: Network via /async/select-options (Authenticated, Low Privileges)
  • Patched Version: Bolt Core 6.1.4
  • Exploit Status: Public Proof-of-Concept Available
  • CISA KEV Status: Not Listed

Affected Systems

  • Bolt CMS (bolt/core) versions prior to 6.1.4
  • bolt/core: < 6.1.4 (Fixed in: 6.1.4)

Code Analysis

Commit: 2818347

Fix SQL injection in ListFormatHelper by binding content-type slugs as query parameters using ArrayParameterType::STRING.

File: src/Utils/ListFormatHelper.php
@@ -4,6 +4,7 @@

 use Bolt\Configuration\Content\ContentType;
 use Bolt\Repository\ContentRepository;
+use Doctrine\DBAL\ArrayParameterType;
 use Doctrine\DBAL\Connection;
 use Doctrine\ORM\EntityManagerInterface;

@@ -67,14 +68,15 @@ public function getRelated(ContentType $contentType, int $amount, string $order)
         $order = $this->fixOrder($order);

         $query = sprintf(
-            'SELECT id, list_format FROM %scontent WHERE content_type = "%s" ORDER BY %s LIMIT %d ',
+            'SELECT id, list_format FROM %scontent WHERE content_type = :contentType ORDER BY %s LIMIT %d ',
             $this->prefix,
-            $contentType['slug'],
             $order,
             $amount
         );

-        $rows = $this->connection->fetchAllAssociative($query);
+        $rows = $this->connection->fetchAllAssociative($query, [
+            'contentType' => $contentType['slug'],
+        ]);

         $options = [];

@@ -90,14 +92,15 @@ public function getMenuLinks(ContentType $contentType, int $amount, string $orde
         $order = $this->fixOrder($order);

         $query = sprintf(
-            'SELECT id, title FROM %scontent WHERE content_type = "%s" ORDER BY %s LIMIT %d ',
+            'SELECT id, title FROM %scontent WHERE content_type = :contentType ORDER BY %s LIMIT %d ',
             $this->prefix,
-            $contentType['slug'],
             $order,
             $amount
         );

-        $rows = $this->connection->fetchAllAssociative($query);
+        $rows = $this->connection->fetchAllAssociative($query, [
+            'contentType' => $contentType['slug'],
+        ]);

         $options = [];

@@ -119,14 +122,17 @@ public function getSelect(string $contentType, array $params): array
         $amount = (int) $params['limit'];

         $query = sprintf(
-            'SELECT id, list_format FROM %scontent WHERE content_type IN (%s) ORDER BY %s LIMIT %d ',
+            'SELECT id, list_format FROM %scontent WHERE content_type IN (:contentTypes) ORDER BY %s LIMIT %d ',
             $this->prefix,
-            $contentTypes,
             $order,
             $amount
         );

-        $rows = $this->connection->fetchAllAssociative($query);
+        $rows = $this->connection->fetchAllAssociative(
+            $query,
+            ['contentTypes' => $contentTypes],
+            ['contentTypes' => ArrayParameterType::STRING]
+        );

         $options = [];

@@ -172,11 +178,11 @@ public function fixOrder(string $order): string
         return $order . ' ' . $direction;
     }

-    private function split(string $contenttypes): string
+    /**
+     * @return string[]
+     */
+    private function split(string $contenttypes): array
     {
-        $parts = explode(',', (string) preg_replace('/^\((.*)\)$/', '$1', (string) $contenttypes));
-        $result = sprintf('"%s"', implode('", "', $parts));
-
-        return $result;
+        return explode(',', (string) preg_replace('/^\((.*)\)$/', '$1', (string) $contenttypes));
     }
 }
Enter fullscreen mode Exit fullscreen mode

Exploit Details

  • GitHub: Public PoC and differential test lab demonstrating SQL injection in Bolt ListFormatHelper via UNION SELECT payloads.

Mitigation Strategies

  • Upgrade bolt/core to version 6.1.4 or later to ensure all queries in ListFormatHelper use parameterized statements.
  • Disable the general/caching/list_format directive in config/bolt/config.yaml as a temporary workaround if immediate patching is not possible.
  • Audit authenticated backend users and restrict upload permissions to strictly trusted accounts.
  • Deploy WAF rules to inspect and block SQL metacharacters (such as double quotes and UNION SELECT clauses) in requests to /async/select-options.

Remediation Steps:

  1. Check the currently installed version of bolt/core by running: composer show bolt/core
  2. Update bolt/core to version 6.1.4 or later using Composer: composer require bolt/core:^6.1.4
  3. If unable to upgrade immediately, open config/bolt/config.yaml and set general.caching.list_format to false.
  4. Clear the application cache using: php bin/console cache:clear
  5. Review database and web server access logs for anomalous requests to /async/select-options containing SQL syntax.

References


Read the full report for CVE-2026-77378 on our website for more details including interactive diagrams and full exploit analysis.

Top comments (0)