CVE-2026-27149 Overview
CVE-2026-27149 is a SQL Injection vulnerability affecting Discourse, a popular open source discussion platform. The vulnerability exists in the private message tag filtering functionality (list_private_messages_tag), where insufficient input sanitization allows attackers to inject malicious SQL queries. Successful exploitation can bypass tag filter conditions and potentially disclose unauthorized private message metadata to authenticated users.
Critical Impact
Authenticated attackers can exploit SQL injection in PM tag filtering to access private message metadata they should not have access to, potentially exposing sensitive user communications.
Affected Products
- Discourse versions prior to 2025.12.2
- Discourse versions prior to 2026.1.1
- Discourse versions prior to 2026.2.0
Discovery Timeline
- 2026-02-26 - CVE CVE-2026-27149 published to NVD
- 2026-02-26 - Last updated in NVD database
Technical Details for CVE-2026-27149
Vulnerability Analysis
This SQL Injection vulnerability resides in the list_private_messages_tag function of Discourse's private messaging system. The vulnerability occurs when user-supplied tag filter parameters are incorporated into SQL queries without proper sanitization or parameterization. When users filter private messages by tags, the application constructs database queries dynamically using the tag input. Because this input is not adequately validated, an attacker can craft malicious input that modifies the intended SQL query structure.
The exploitation requires low-privilege authenticated access to the Discourse platform. Once authenticated, an attacker can manipulate tag filter parameters to inject SQL commands that bypass the intended filtering logic. This allows extraction of private message metadata that would normally be restricted based on access controls. The vulnerability has no impact on data integrity or system availability—it is limited to confidentiality exposure.
Root Cause
The root cause is improper input validation (CWE-89: SQL Injection) in the tag filtering mechanism for private messages. The list_private_messages_tag function fails to properly sanitize or parameterize user-controlled input before incorporating it into SQL queries. This allows attackers to break out of the intended query context and inject arbitrary SQL commands.
Attack Vector
The attack is network-based and requires authentication to the Discourse platform. An attacker would:
- Authenticate to the Discourse instance with a valid user account
- Navigate to private message filtering functionality
- Craft a malicious tag filter parameter containing SQL injection payloads
- Submit the request, causing the injected SQL to execute against the database
- Extract private message metadata from the response or through inference techniques
The vulnerability is exploited through manipulating the tag filter parameter in API requests to the list_private_messages_tag endpoint. By injecting SQL syntax into the tag parameter, attackers can modify query conditions to return metadata from private messages they are not authorized to view.
For complete technical details on the vulnerability mechanism, refer to the GitHub Security Advisory.
Detection Methods for CVE-2026-27149
Indicators of Compromise
- Unusual SQL syntax characters in tag filter parameters (e.g., single quotes, semicolons, UNION keywords)
- Abnormal private message API access patterns from authenticated users
- Error messages or application exceptions related to malformed SQL queries in PM endpoints
- Users accessing private message metadata outside their normal access scope
Detection Strategies
- Implement Web Application Firewall (WAF) rules to detect SQL injection patterns in tag filter parameters
- Monitor application logs for SQL syntax errors originating from the list_private_messages_tag endpoint
- Deploy runtime application self-protection (RASP) to detect and block SQL injection attempts
- Configure database query logging to identify anomalous queries from the private message subsystem
Monitoring Recommendations
- Enable detailed logging for all private message API endpoints, particularly tag filtering operations
- Set up alerts for authentication followed by unusual PM metadata access patterns
- Monitor database query execution times for anomalies that may indicate injection-based enumeration
- Review access logs for repeated requests to PM tag filtering with varying payloads
How to Mitigate CVE-2026-27149
Immediate Actions Required
- Upgrade Discourse to version 2025.12.2, 2026.1.1, or 2026.2.0 immediately
- Audit access logs for any signs of exploitation prior to patching
- Review private message access patterns for anomalous behavior
- Consider temporarily disabling PM tag filtering if immediate patching is not possible
Patch Information
The Discourse development team has released security patches addressing this vulnerability in versions 2025.12.2, 2026.1.1, and 2026.2.0. Organizations running affected versions should upgrade to one of these patched releases as soon as possible. The patch properly sanitizes and parameterizes user input in the list_private_messages_tag function to prevent SQL injection.
For additional information, see the GitHub Security Advisory.
Workarounds
- No official workarounds are available for this vulnerability
- Patching to a fixed version is the only recommended remediation
- Organizations unable to patch immediately should implement WAF rules to filter SQL injection patterns
- Consider restricting access to the private message tag filtering functionality until patching is complete
# Upgrade Discourse to patched version
cd /var/discourse
git pull
./launcher rebuild app
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

