Safeguard
Vulnerability Analysis•

CVE-2024-2338: High SQL Injection in PostgreSQL Anonymizer 1.2

CVE-2024-2338 is a high SQL injection in PostgreSQL Anonymizer 1.2 that lets a table owner reach superuser with dynamic masking. Upgrade to 1.3.

Safeguard Security Team
3 min read

CVE-2024-2338 is a high severity (8.0) flaw in PostgreSQL Anonymizer 1.2: a SQL injection that allows a user who owns a table to elevate to superuser when dynamic masking is enabled. The record says version 1.3 resolves the problem. Upgrade the extension to 1.3 or later.

Weakness: CWE-89 (SQL Injection).

What's affected

  • Affected: Dalibo PostgreSQL Anonymizer v1.2 (CPE 1.2.0).
  • Fixed: version 1.3, per the record.
  • Attack conditions: CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:H. Attack complexity is high and high privileges are needed, since the attacker must already own a table, but scope is changed because the result is superuser.

a SQL injection that allows a user who owns a table to elevate to superuser when dynamic masking is enabled. The flaw is that complex expressions can be supplied as a masking value and are later used as is to build masked views.

Dynamic masking must be enabled, and the attacker must own a table. Users who do not own a table, including masked users, cannot exploit it, according to the record.

How to check if you're exposed

PostgreSQL Anonymizer is a database extension, so check inside the database.

  1. Run SELECT extname, extversion FROM pg_extension WHERE extname = 'anon'; in each database to see the installed version.
  2. List which roles own tables that carry masking security labels, for example by querying pg_seclabels.
  3. Check whether dynamic masking is enabled in your configuration.

If you build images, also check the extension package version in your Dockerfiles.

What to do now

  1. Upgrade the anon extension to 1.3 or later and run the extension update step in each database that uses it.
  2. Until upgraded, do not apply static masking or anonymous dump with a privileged account on tables owned by users you do not trust.
  3. Review which roles own masked tables and reduce table ownership to those who need it.
  4. After upgrading, review security labels on tables for unexpected expressions or functions.
  5. Record the extension version in your inventory.

Why it matters

The record classes this as CWE-89 (SQL Injection). Both issues come from the same pattern: data or code defined by a lower-privileged user is later executed by a more privileged one. In a masking tool, the privileged step is the one that builds masked views or runs masking functions, so anything a table owner can plant there runs with superuser rights.

NVD scored it 8.0 (High), held down by high complexity and the need for table ownership. The sibling issue is CVE-2024-2339, also fixed in 1.3. The KEV flag is false.

Try it yourself

Click through it at your own pace, or open it full screen.

Quick check

Which version fixes CVE-2024-2338?

The record says PostgreSQL Anonymizer 1.3 resolves it.

Are masked users at risk?

The record says users who do not own a table, especially masked users, cannot exploit it.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.