Skip to main content
Vulnerability Database/CVE-2026-87938

CVE-2026-87938: Drupal CSP Log SQL Injection Vulnerability

CVE-2026-87938 is a SQL injection vulnerability in Drupal CSP Log module that allows attackers to execute malicious SQL commands. This post covers technical details, affected versions, security impact, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-87938 Overview

CVE-2026-87938 is a SQL injection vulnerability [CWE-89] in the Drupal CSP log contributed module. The flaw stems from improper neutralization of special elements used in SQL commands. Affected versions range from 0.0.0 through 1.0.2. Attackers can inject crafted SQL statements through unsanitized input processed by the module, potentially manipulating backend database queries. The vulnerability was published to the National Vulnerability Database (NVD) on October 22, 2026.

Critical Impact

Successful exploitation can allow attackers to read, modify, or delete arbitrary data in the Drupal database, including administrative credentials and site content.

Affected Products

  • Drupal CSP log module versions 0.0.0 through 1.0.2
  • Drupal sites with the CSP log contributed module installed
  • Any environment where CSP log receives untrusted input

Discovery Timeline

  • 2026-10-22 - CVE CVE-2026-87938 published to NVD
  • 2026-10-22 - Last updated in NVD database

Technical Details for CVE-2026-87938

Vulnerability Analysis

The CSP log module records Content Security Policy (CSP) violation reports submitted by browsers. The module passes report data into database queries without proper parameterization or escaping. An attacker who can submit CSP violation reports to the endpoint can embed SQL metacharacters inside report fields. The Drupal database abstraction layer then executes the attacker-controlled fragments as part of a legitimate query.

Because CSP reports are typically accepted without authentication, the attack surface is reachable by any remote client that can reach the reporting endpoint. The flaw affects all releases up to and including version 1.0.2.

Root Cause

The root cause is improper neutralization of special elements used in an SQL command [CWE-89]. Input values destined for SQL statements are concatenated or interpolated instead of bound as parameters. Standard Drupal database API placeholders such as :placeholder are not used consistently in the vulnerable code paths.

Attack Vector

An unauthenticated attacker crafts an HTTP request to the CSP reporting endpoint exposed by the module. The request body contains JSON fields with SQL payloads in attributes such as document-uri, blocked-uri, or violated-directive. When the module writes the report to storage, the injected SQL executes against the Drupal database. Further technical details are referenced in the Drupal Security Advisory SA-CONTRIB-2026-136.

Detection Methods for CVE-2026-87938

Indicators of Compromise

  • Unexpected entries in the CSP log table containing SQL keywords such as UNION, SELECT, SLEEP, or INFORMATION_SCHEMA
  • HTTP POST requests to CSP reporting endpoints with abnormally large or syntactically malformed JSON bodies
  • Database error messages referencing the CSP log module in Drupal watchdog logs
  • New or modified administrative user accounts with no corresponding audit trail

Detection Strategies

  • Review web server access logs for POST requests to the CSP report URI containing SQL metacharacters such as single quotes, comment markers, or OR 1=1 patterns
  • Enable Drupal query logging in a staging environment and inspect queries issued by the CSP log module for unparameterized string concatenation
  • Compare installed CSP log module version against the fixed release listed in the vendor advisory

Monitoring Recommendations

  • Alert on database errors originating from the CSP log module
  • Monitor outbound database traffic for unusual query volume from the Drupal application user
  • Track changes to the users_field_data and user__roles tables for unexpected privilege assignments

How to Mitigate CVE-2026-87938

Immediate Actions Required

  • Upgrade the CSP log module to a release later than 1.0.2 as published in the Drupal security advisory
  • Audit the CSP log database table for suspicious entries predating the upgrade
  • Rotate Drupal administrative credentials and API tokens if indicators of exploitation are present
  • Restrict access to the CSP reporting endpoint using web server rules until the patch is applied

Patch Information

Drupal has issued a fixed release of the CSP log module. Refer to the Drupal Security Advisory SA-CONTRIB-2026-136 for the specific patched version and upgrade instructions. Apply the update through Composer or the Drupal update manager and clear the site cache after installation.

Workarounds

  • Disable and uninstall the CSP log module until the patched version is deployed
  • Block POST requests to the CSP report endpoint at the web application firewall when the module cannot be removed
  • Apply a strict allowlist on request body size and content type for the reporting endpoint
bash
# Configuration example: disable the module via Drush until patched
drush pm:uninstall csp_log
drush cache:rebuild

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.