MEDIUM 6.4

CVE-2026-11945: PostgreSQL Anonymizer Privilege Escalation via Malicious JSON

PostgreSQL Anonymizer, an extension for PostgreSQL that helps mask sensitive data, contains a privilege escalation vulnerability. An authenticated attacker with standard user privileges can craft a malicious JSON document and trick a database superuser into importing it using specific functions (import_database_rules() or import_roles_rules()). When the superuser processes the JSON, hidden malicious code executes with superuser-level privileges, giving the attacker complete database access. This requires both user authentication and superuser action, limiting the immediate risk but creating a serious supply-chain or trusted-user threat.

Source data · NVD / CISA · public domain

CVSS
3.1 · 6.4 MEDIUM · CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:H
Weaknesses (CWE)
CWE-89
Affected products
1 configuration(s)
Published / Modified
2026-06-11 / 2026-06-17

NVD description (verbatim)

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

1 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The vulnerability exists in how PostgreSQL Anonymizer processes JSON input during database rule and role rule imports. Attackers can embed arbitrary code within JSON key-value pairs that evade sanitization checks. When a superuser invokes import_database_rules() or import_roles_rules() functions on attacker-controlled JSON, the embedded code executes in the superuser's security context. The root cause is improper input validation and insufficient code isolation during JSON parsing and execution. CWE-89 (SQL Injection) classification suggests the injection vector may involve SQL statement manipulation embedded in JSON structures.

Business impact

Successful exploitation allows a standard database user to escalate privileges to superuser, enabling them to read, modify, or delete any data, create backdoor accounts, or sabotage database operations. For organizations using PostgreSQL Anonymizer in compliance-sensitive environments (healthcare, finance, PII handling), this undermines the extension's core function of protecting sensitive data. The attack requires superuser action, making it most dangerous in scenarios involving data imports from third parties, shared development environments, or scenarios where superusers routinely process rule files. Compromise could expose masked data or allow exfiltration of unmasked records.

Affected systems

PostgreSQL Anonymizer versions prior to 3.1.1 are vulnerable. The extension runs as part of PostgreSQL and affects all installations using Anonymizer for data masking. The vulnerability is platform-agnostic (Linux, Windows, macOS) and impacts any PostgreSQL instance where the extension is installed and superusers interact with user-supplied JSON rule files. Organizations should verify their current Anonymizer version against the vendor's release notes.

Exploitability

Exploitability is moderate. The attack requires three conditions: (1) the attacker must have authenticated database access, (2) the attacker must create a malicious JSON file and deliver it to a superuser, and (3) the superuser must actively call one of two specific import functions on that JSON. This is not a zero-click or remote unauthenticated attack. However, in environments where rule files are regularly imported (e.g., automated compliance policy updates, database migrations, or shared development workflows), the bar for exploitation lowers significantly. The requirement for direct superuser action prevents worm-like propagation but enables targeted privilege escalation against database administrators.

Remediation

Upgrade PostgreSQL Anonymizer to version 3.1.1 or later. Dalibo (the extension maintainer) has patched the JSON parsing logic to properly validate and sanitize input before code execution. Organizations should verify patch availability and test in non-production environments before deployment. Until patching is complete, restrict import_database_rules() and import_roles_rules() invocations to JSON files from trusted sources only, and audit historical imports for suspicious activity.

Patch guidance

Consult the PostgreSQL Anonymizer release notes and Dalibo's official advisory to confirm version 3.1.1 availability for your PostgreSQL version and platform. Verify patch compatibility with your current Anonymizer version and any dependent applications before applying. Test the update in a staging environment to ensure compliance rules and masking functions remain intact. Deploy during a maintenance window. Monitor PostgreSQL logs for any anomalies post-patching. If version 3.1.1 is not yet available for your PostgreSQL release, contact Dalibo support or consider temporarily disabling Anonymizer in high-risk environments.

Detection guidance

Monitor for suspicious invocations of import_database_rules() or import_roles_rules() in PostgreSQL audit logs, especially when called by superusers or database administrators. Inspect JSON files passed to these functions for embedded code patterns, unusual escape sequences, or payloads that deviate from expected rule structure. Establish a baseline of legitimate rule imports and alert on deviations. Review PostgreSQL error logs for SQL injection attempts or code execution errors during JSON import operations. If your organization stores historical rule files, audit them for malicious patterns. Enable PostgreSQL statement logging for these specific functions to capture the full JSON payloads in forensics scenarios.

Why prioritize this

This vulnerability rates as medium severity (CVSS 6.4) but warrants priority attention because it enables direct privilege escalation in database systems that handle sensitive data. The requirement for superuser action makes it a targeted attack vector rather than a mass-exploitation risk, but for organizations relying on Anonymizer for compliance and PII protection, privilege escalation is a worst-case outcome. The CVE does not yet appear on CISA's KEV list, suggesting active exploitation is limited, but this should not delay patching given the severity of superuser compromise. Prioritize patching based on whether your superusers regularly import external rule files and your organization's data sensitivity.

Risk score, explained

The CVSS 3.1 score of 6.4 (MEDIUM) reflects high confidentiality, integrity, and availability impact if exploited, but is tempered by high attack complexity (AC:H) and the requirement for high privilege level and user interaction (PR:H, UI:R). The network-accessible vector (AV:N) indicates remote authentication is sufficient, but the confluence of authentication, superuser involvement, and the need to trick a superuser into importing attacker JSON keeps the score in the medium range. For data-sensitive environments, the business impact may justify treating this as higher priority than the numeric score alone suggests.

Frequently asked questions

Do we need to patch immediately if we don't regularly import external rule files?

Patch within your normal security update cycle. The vulnerability requires superuser action on attacker-supplied JSON, so if your JSON rule sources are internal and tightly controlled, your risk window is smaller. However, do not delay indefinitely; internal threats and supply-chain compromises (e.g., a developer with access to rule repositories) can still pose a risk.

Can this vulnerability be exploited without database authentication?

No. The attacker must be an authenticated database user. This distinguishes it from remotely exploitable flaws and makes it primarily a concern for insider threats, compromised application accounts, or scenarios where database access is widely distributed.

Does PostgreSQL Anonymizer 3.1.0 address this issue?

Verify against Dalibo's official release notes. The provided data specifies that version 3.1.1 and further versions are patched. Do not assume earlier 3.1.x releases are safe without explicit confirmation from the vendor.

What should we do with existing imported rule files if we suspect tampering?

Audit a sample of previously imported JSON files for malicious patterns (embedded SQL, shell commands, or unusual escape sequences). If your audit logs show suspicious imports, treat the affected databases as potentially compromised—rotate superuser credentials, review access logs for unauthorized activity, and consider a security incident investigation. Dalibo or your PSIRT may provide forensic guidance.

This analysis is based on the CVE record published on 2026-06-11 and modified 2026-06-17. Specific version numbers, availability timelines, and patch details should be verified against Dalibo's official PostgreSQL Anonymizer advisory and release notes. Organizations should consult their vendor and security teams before deploying patches. SEC.co makes no warranty regarding the completeness or real-time accuracy of this intelligence. This is a factual analysis for informational purposes; it does not constitute professional security advice or guarantee of risk elimination. Source: NVD (public-domain), retrieved 2026-07-20. Analysis generated by SEC.co (claude-haiku-4-5).