NocoBase Authenticated SQL Injection to RCE
A critical SQL injection vulnerability in NocoBase allows authenticated attackers to achieve remote code execution on the underlying PostgreSQL container via stacked statements.
NocoBase versions 2.0.60 and earlier contain a critical SQL injection vulnerability in the /api/myInAppChannels:list endpoint. The vulnerability arises because the latestMsgReceiveTimestamp filter parameter is unsafely interpolated into a Sequelize.literal() template string without proper escaping or parameter binding. Because NocoBase defaults to allowing anonymous account registration (allowSignUp: true), any unauthenticated attacker can create an account and access this endpoint.
The application utilizes the pg driver, which supports stacked SQL statements. Coupled with the default PostgreSQL container configuration where the nocobase database user is granted superuser privileges (rolsuper=true), an attacker can execute arbitrary system commands using the COPY ... TO PROGRAM syntax. This vulnerability leads to full database compromise, including sensitive data exfiltration (such as administrator password hashes) and remote code execution within the database container.
Attack Chain
- Attacker interacts with the
/api/auth:signUpendpoint to create a new user account, exploiting the defaultallowSignUp: trueconfiguration. - Attacker performs an authentication request to
/api/auth:signInto obtain a validmemberrole JSON Web Token (JWT). - Attacker identifies the vulnerable
filter[latestMsgReceiveTimestamp][$lt]parameter on the/api/myInAppChannels:listendpoint. - Attacker validates the injection point using a time-based oracle payload (e.g.,
PG_SLEEP(5)). - Attacker crafts a malicious HTTP GET request containing a stacked-statement SQL payload using
COPY ... TO PROGRAM. - The backend database executes the injected command with the privileges of the
postgressystem user (uid 999). - Attacker achieves command execution and can exfiltrate sensitive collections or system data from the host container.
Impact
Successful exploitation allows unauthenticated attackers to gain full access to the NocoBase database. The impact includes the exfiltration of sensitive information, such as administrator credentials (stored as PBKDF2 hashes), and remote code execution within the database container, which may facilitate lateral movement or further environment compromise.
Recommendation
- Upgrade NocoBase to version 2.0.61 or later immediately.
- Disable anonymous sign-ups by modifying the
auth-basicconfiguration if registration is not required. - Review database role privileges and ensure the PostgreSQL user configured for NocoBase follows the principle of least privilege rather than running as a superuser.
- Deploy the provided Sigma rule to detect anomalous requests to the
/api/myInAppChannels:listendpoint.
Detection coverage 1
Detect NocoBase CVE-2026-52887 Exploitation Attempt
criticalDetects exploitation attempts against CVE-2026-52887 by identifying suspicious SQL syntax within the filter query parameter of the myInAppChannels endpoint.
Detection queries are available on the platform. Get full rules →