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-115331 Overview
CVE-2026-115331 is a SQL injection vulnerability in the Lotus open-source billing platform through version 0.10.2. Authenticated organization users can inject arbitrary SQL by supplying crafted billable metric property_name values or categorical filter values. These inputs are rendered unescaped into Jinja-generated counter, gauge, and rate metric queries. Because Lotus stores data for all tenants in a shared database, exploitation enables cross-tenant data access. The flaw is tracked under CWE-89 (Improper Neutralization of Special Elements used in an SQL Command).
Critical Impact
Any authenticated tenant user can read, modify, or exfiltrate data belonging to every other tenant that shares the backend database.
Affected Products
- Lotus billing platform (uselotus/lotus) versions through 0.10.2
- Deployments using the counter_query_templates.py Jinja templates
- Multi-tenant Lotus instances sharing a single backend database
Discovery Timeline
- 2026-10-22 - CVE CVE-2026-115331 published to NVD
- 2026-10-22 - Last updated in NVD database
Technical Details for CVE-2026-115331
Vulnerability Analysis
Lotus generates SQL for billable metric aggregations by rendering Jinja templates for counter, gauge, and rate metric types. The templates interpolate user-controlled property_name and categorical filter values directly into SQL fragments without parameterization or identifier escaping. An authenticated organization user with permission to create or modify billable metrics can embed SQL syntax inside these fields. When Lotus later evaluates the metric, the attacker-supplied SQL executes against the shared backend database. See the VulnCheck SQL Injection Advisory for the full technical write-up.
Root Cause
The root cause is unsafe string interpolation in the Jinja query templates located in counter_query_templates.py. Metric property names and categorical filter values are concatenated into dynamic SQL rather than bound as query parameters. Identifier-position inputs cannot be parameterized by standard database drivers, so proper allowlisting and quoting is required and absent.
Attack Vector
An attacker authenticates to any tenant organization on a vulnerable Lotus instance. They create or edit a billable metric and supply a property_name or categorical filter value containing SQL syntax such as subqueries, UNION clauses, or stacked statements. When the counter, gauge, or rate aggregation runs, the injected SQL executes with the privileges of the application's database role. Because Lotus is multi-tenant on a shared schema, the attacker can query and modify billing data across all organizations, including usage events, invoices, and credentials stored in the database.
Detection Methods for CVE-2026-115331
Indicators of Compromise
- Billable metric records whose property_name or categorical filter columns contain SQL metacharacters such as single quotes, parentheses, --, /*, UNION, or SELECT.
- Database logs showing unexpected queries referencing tables outside the current organization scope.
- Application errors or long-running queries originating from metric aggregation jobs.
Detection Strategies
- Audit the Lotus application database for metric definitions containing SQL keywords or quoting characters in identifier fields.
- Enable PostgreSQL log_statement = 'all' or equivalent and review queries generated by metering_billing.aggregation for anomalous structure.
- Review web application logs for metric create and update API calls that submit unusual property_name or filter payloads.
Monitoring Recommendations
- Alert on database errors referencing malformed identifiers or syntax errors from the Lotus application user.
- Monitor for cross-tenant data access patterns, such as queries returning rows for organization_id values the requesting user does not belong to.
- Track creation of new billable metrics by low-privileged organization accounts and flag payloads that fail input validation.
How to Mitigate CVE-2026-115331
Immediate Actions Required
- Restrict billable metric creation and modification to trusted administrators until a patched release is deployed.
- Review all existing billable metrics for suspicious property_name and categorical filter values and purge any that contain SQL syntax.
- Rotate database credentials and application secrets if evidence of exploitation is found.
Patch Information
No fixed version is published at the time of writing. The vulnerability affects Lotus through 0.10.2. Monitor the GitHub Lotus Project Repository and the VulnCheck SQL Injection Advisory for a vendor fix. Consider forking and applying local patches that validate identifiers against an allowlist and parameterize all literal values before merging into aggregation templates.
Workarounds
- Enforce strict server-side allowlisting of metric property_name values to alphanumeric characters and underscores before persistence.
- Reject categorical filter values that contain quotes, semicolons, SQL comment markers, or parenthesis characters.
- Isolate tenants into separate databases or schemas so that successful SQL injection cannot reach other organizations.
- Run the Lotus application database role with least privilege, limiting access to only the required tables.
# Example PostgreSQL least-privilege configuration for the Lotus app role
REVOKE ALL ON SCHEMA public FROM lotus_app;
GRANT USAGE ON SCHEMA public TO lotus_app;
GRANT SELECT, INSERT, UPDATE, DELETE
ON metering_billing_event, metering_billing_billablemetric
TO lotus_app;
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

