CVE-2026-11945
Received Received - Intake
Privilege Escalation in PostgreSQL Anonymizer

Publication date: 2026-06-11

Last updated on: 2026-06-11

Assigner: PostgreSQL

Description
PostgreSQL Anonymizer contains a vulnerability that allows a user to gain superuser privileges by creating a JSON document and placing malicious code inside a particular key-value pair. If a superuser calls the import_database_rules() or import_roles_rules() functions, the malicious code is executed with superuser privileges. The problem is resolved in PostgreSQL Anonymizer 3.1.1 and further versions
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-06-11
Last Modified
2026-06-11
Generated
2026-06-11
AI Q&A
2026-06-11
EPSS Evaluated
N/A
NVD
EUVD
Affected Vendors & Products
Showing 2 associated CPEs
Vendor Product Version / Range
dalibo postgresql_anonymizer From 3.1.1 (inc)
dalibo postgresql_anonymizer From 3.2.0-dev (inc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-89 The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.
Attack-Flow Graph
AI Quick Actions
Instant insights powered by AI
Executive Summary

This vulnerability exists in the PostgreSQL Anonymizer extension, specifically in the functions import_database_rules() and import_roles_rules(). It allows an attacker to inject malicious SQL code by crafting a JSON document with specially crafted key-value pairs. The vulnerable functions improperly handle untrusted input when constructing SECURITY LABEL statements, enabling the attacker to close the SQL literal and append arbitrary SQL commands.

If a superuser or privileged user calls these functions with the malicious JSON, the injected SQL code is executed with their privileges, potentially allowing the attacker to perform unauthorized actions such as creating new roles, executing DDL commands, or manipulating data.

The vulnerability is a form of SQL injection that arises from unsafe interpolation of untrusted input into SQL statements.

Impact Analysis

This vulnerability can have serious impacts if exploited. An attacker who can supply malicious JSON input and have it imported by a privileged user can execute arbitrary SQL commands with superuser or equivalent privileges.

  • Creation of new database roles or users, potentially escalating their own privileges.
  • Execution of arbitrary DDL commands such as creating or dropping tables.
  • Manipulation or corruption of data within the database.

Overall, this can lead to full compromise of the database system, data breaches, and loss of data integrity.

Detection Guidance

This vulnerability can be detected by monitoring the use of the functions anon.import_roles_rules(jsonb, text) and anon.import_database_rules(jsonb, text) in your PostgreSQL Anonymizer extension. Specifically, look for calls to these functions that import JSON documents containing potentially malicious or unexpected SQL code within the SECURITY LABEL statements.

You can audit database logs for executions of these functions by superusers or privileged roles, as the vulnerability is exploitable when these functions are called by such users.

Suggested commands to detect suspicious activity include:

  • Enable PostgreSQL logging for function calls and SQL statements, for example, set `log_statement = 'all'` in postgresql.conf temporarily.
  • Query the PostgreSQL logs for calls to anon.import_roles_rules or anon.import_database_rules functions.
  • Use SQL to check recent calls to these functions, for example, if you have an audit extension installed, query audit logs for calls to these functions.
  • Manually review JSON documents being imported via these functions for suspicious or malformed SECURITY LABEL entries that could contain injected SQL.
Mitigation Strategies

The immediate mitigation step is to upgrade the PostgreSQL Anonymizer extension to version 3.1.1 or later, where this vulnerability has been fixed.

Until the upgrade can be performed, restrict the execution of the vulnerable functions anon.import_roles_rules() and anon.import_database_rules() to trusted superusers only, and audit their usage closely.

Avoid importing JSON documents from untrusted sources that could contain malicious code.

Review and tighten permissions on the PostgreSQL Anonymizer extension and related database roles to minimize exposure.

Compliance Impact

This vulnerability allows an attacker to execute arbitrary SQL commands with the privileges of a superuser if a superuser imports malicious JSON data using the vulnerable functions. Such unauthorized privilege escalation and potential data manipulation can lead to unauthorized access, modification, or disclosure of sensitive data.

As a result, this vulnerability could negatively impact compliance with common standards and regulations like GDPR and HIPAA, which require strict controls over access to sensitive personal and health data, as well as measures to prevent unauthorized data access and ensure data integrity.

Chat Assistant
Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-11945. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70
EPSS Chart