The attacker needs a database session. With PostgreSQL's default privileges, every role that can connect to a database may create temporary objects in it, so ordinary accounts meet the condition unless an administrator has revoked that right. The CVE record credits Claude, the AI model made by Anthropic, and the security firm Ada Logics with reporting the bug.
Key Facts
Data as of November 27, 2026.
| Field | Details |
|---|---|
| CVE | CVE-2026-120151 |
| Product | PostgreSQL server: record-field assignment in PL/pgSQL |
| Affected versions | PostgreSQL 14 to 18 before 18.7, 17.12, 16.16, 15.20 and 14.25 (PostgreSQL security page). Treat the unsupported 13 and older as affected too |
| Fixed in | 18.7, 17.12, 16.16, 15.20 and 14.25, released November 12, 2026. PostgreSQL 19.0 is not listed as affected |
| Condition | The attacker "has permission to create objects (temporary objects or non-temporary objects in at least one schema)" (CVE record) |
| Severity | CVSS 3.1: 8.8 High (PostgreSQL), AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H. Red Hat and Amazon Linux: Important |
| Exploitation | Not in the CISA KEV catalog; CISA's assessment records no exploitation. EPSS 0.0057 (0.57%), 41st percentile. No public proof of concept found on GitHub |
| Reported by | "Claude and Ada Logics" (CVE record and PostgreSQL release notes) |
| Role of AI | The CVE record names Claude, an AI system, among the reporters, together with Ada Logics |
| Weakness | CWE-843, type confusion |
| Disclosed | November 12, 2026 |
| Related CVE | CVE-2026-120150, a use-after-free in expanded-record domain checks: same credits, same release |
Who Is Affected
You are affected if a PostgreSQL server runs a version below 18.7, 17.12, 16.16, 15.20 or 14.25 and someone you do not fully trust can open a session on it with a role that may create objects, temporary ones included.
Why Any Login Is Enough
That bar is low. By default PostgreSQL grants CONNECT and TEMPORARY on every new database to PUBLIC, which means to every role, and installs PL/pgSQL. Application accounts, reporting users, BI and ETL connections, and third-party integrations all qualify if they can connect and the defaults are in place. On PostgreSQL 14 and older, and in databases upgraded from those versions, every role can also create objects in the public schema unless that privilege was revoked.
The result is code running as the operating system account of the database service, so a role that may only read one table ends up with the server's own access on the host. Red Hat says the flaw "circumvents standard database engine isolation to fully compromise database host integrity and confidentiality."
How to Check Your Systems

1. Check the version of the running server. Connect with psql and run:
SELECT version();
The server reports the version of the binary it started with. After a package update it still shows the old version until PostgreSQL restarts, so this is also how you confirm the fix is live. One host can run several clusters, so look at the packages as well:
# Debian, Ubuntu: clusters with their major version and port, then packages
pg_lsclusters
dpkg -l 'postgresql*'
# RHEL, Rocky, Alma, Amazon Linux
rpm -qa 'postgresql*'
pg_lsclusters gives only the major version; the minor version comes from the packages. Distribution packages are fixed under their own version strings, such as 15.20-0+deb12u1 on Debian 12 and 17.12-0+deb13u1 on Debian 13, so compare yours with your distribution's tracker.
2. Check containers. For each PostgreSQL container in docker ps, docker exec <container> postgres --version shows the installed version and SELECT version() what the server runs. A container on an affected version stays affected until you pull a fixed tag and recreate it; a pinned old tag or digest will not pick up the fix.
3. Find the roles that meet the condition. Run these queries in every database, because TEMPORARY is granted per database:
-- Login roles that can create temporary objects in this database
SELECT rolname
FROM pg_roles
WHERE rolcanlogin
AND has_database_privilege(oid, current_database(), 'TEMPORARY');
-- Schemas where login roles can create objects
SELECT n.nspname AS schema, r.rolname AS role
FROM pg_namespace n
CROSS JOIN pg_roles r
WHERE r.rolcanlogin
AND n.nspname NOT LIKE 'pg\_%'
AND n.nspname <> 'information_schema'
AND has_schema_privilege(r.oid, n.oid, 'CREATE');
Superusers appear in both lists; they already control the server. Every other role listed meets the CVE record's condition, so check which of them pg_hba.conf and the CONNECT privilege let in. An empty result means only that no login role matched in this database, not that the fix is installed.
4. Check who can connect. Run SHOW listen_addresses; and review pg_hba.conf. From a host outside your network, nc -zv db.example.com 5432 shows whether the port answers from there. If it does, your pg_hba.conf rules decide who gets a session.
How to Fix It
Update to PostgreSQL 18.7, 17.12, 16.16, 15.20 or 14.25, or to your distribution's fixed package. Within the same major version this is a minor update, so you stop the server, update the binaries and start it again, with no dump, reload or pg_upgrade. The same release fixes other bugs that need extra steps, such as reindexing some GIN and pg_trgm indexes, so read the "Updating" section of the announcement before you schedule the restart.
- PostgreSQL 14. 14.25 is the last release of the branch. Patch now and plan a major upgrade.
- PostgreSQL 13 and older. Red Hat marks its PostgreSQL 12 packages as affected, Ubuntu marks its 9.3 package as vulnerable with the fix deferred, and these branches will not get a fix. Upgrade to a supported major version, 15 to 19.
- Managed services. The provider decides when a new minor version reaches your instance. Check which minor versions it offers, your maintenance settings and what
SELECT version()reports on the instance. - Physical replicas. For a minor update within the same major version, the PostgreSQL documentation calls updating the standby servers first "the safest policy": "a new minor release is more likely to be able to read WAL files from a previous minor release than vice versa." It also advises keeping primary and standby servers at the same release level as much as possible. After the rollout, run
SELECT version()on every node.
PostgreSQL publishes no workaround. Red Hat suggests limiting pg_hba.conf to trusted client hosts and revoking CREATE on the public schema from untrusted accounts. That leaves temporary objects, which the CVE record also counts. Revoking TEMPORARY from PUBLIC closes the default path but not explicit or inherited grants or CREATE rights on other schemas, and it breaks applications that use temporary tables. Test it first, and update anyway.
If you run many PostgreSQL servers, I would set the patch order by who holds the logins. Start with the servers that accept sessions from people outside the core team, such as contractors, partners and customers with their own database accounts. Every server still gets the update, but these carry the most risk while the rollout runs. Longer term, have every server report on a schedule the version it actually runs and its list of login roles, each with a named owner. With that list at hand, the next CVE that "requires an authenticated user" is scoped from one table instead of a round of questions to every team.
Aleksandr MelnichukCPO, Project Director
How the Bug Works
In PL/pgSQL, a RECORD variable takes the structure of whatever row is assigned to it, and that structure "can change each time it is assigned to", in the words of the PostgreSQL documentation.
When a function assigns a value to one field of such a record, PL/pgSQL looks up the field's position and data type, converts the value to that type and stores it. According to the fix commit, the conversion step "can reach code that will change the rowtype of a RECORD variable", but the assignment code "assumes the record field type and column number that it previously looked up are still good." The CVE record identifies that code as "a reentrant domain CHECK that changes a RECORD variable's row type while a value is being cast." If the record's structure changes in between, the value is stored according to type information that no longer matches the record. That mismatch is the type confusion (CWE-843) in the CVE title.

The fix rechecks the field's type and position after the conversion whenever the record's type ID has changed. The commit notes that this condition "never holds in normal usage", so the extra check is cheap.
How It Was Found and Fixed
The report date is not public; the timeline starts with the fix:
- November 9, 2026. The fix, written by Tom Lane, is committed to the release branches for PostgreSQL 14 through 18 and the upcoming 19. The commit message reads "plpgsql: recheck record field's type after casting value." and credits Claude and Ada Logics.
- November 12. PostgreSQL releases 18.7, 17.12, 16.16, 15.20, 14.25 and 19 RC 2 with fixes for 52 security vulnerabilities, and the CVE record and the security page go live. The repository behind the official
postgresDocker image switches to the fixed versions the same day. - November 13. Debian publishes DSA-6625-1 for PostgreSQL 17 in Debian 13.
- November 19. Amazon Linux 2023 ships fixed packages. PostgreSQL 19.0 is released; the fix was already in 19 RC 2.
Red Hat still lists the PostgreSQL server packages in RHEL 7 to 10 as affected, except the PostgreSQL 19 package in RHEL 10, with no fixed RHEL package yet, and Ubuntu marks its PostgreSQL packages as needing evaluation.

Anthropic's public disclosure dashboard describes Ada Logics, in general terms, as one of the "external security research firms that work with us to triage Claude's vulnerability findings and notify project maintainers."
What This Says about AI Bug Hunting
Several of the 52 fixes belong to one family of bugs, in code that assumed a row type stays the same while it is in use. The release notes describe CVE-2026-6460, CVE-2026-116306 and this CVE in those terms. Names tied to AI companies appear across the credits, among them "the Anthropic OSS program" and "OpenAI Codex Security". For CVE-2026-116306, the release notes thank both OpenAI Codex Security and Claude and Ada Logics, along with two individual researchers.
On November 16, Anthropic announced shorter disclosure windows for reports it sends from January 1, 2027, and gave this reason: "a bug that one model can find is increasingly likely to be found by another." The commit that fixes this CVE is dated November 9, and its message says what was wrong. Our reading: when several models can find the same bug, a published fix is a lead that others can follow quickly. On servers that accept sessions from roles you do not fully trust, that makes the time between a public fix and your update matter more.
Where Topscan.me Fits
Claude is credited with this bug in PostgreSQL's code, and like other bugs in public projects it now has a CVE number and sits in vulnerability databases. Bugs in your own application rarely get one, so you cannot count on those databases to list them. Topscan.me AI Pentest points AI at your own web application. It reads your code, attacks the running app and backs every confirmed finding with the real request and response, double-checked outside the AI. Issues found only in code are marked Unverified.
Topscan.me's infrastructure scan lists the open ports and the services behind them on the hosts you add, so you can see which database ports answer from outside. Discovery, part of attack surface management, finds hosts and subdomains around your domains that you may not have added yet. Neither replaces the update above, because the fix for CVE-2026-120151 is a new PostgreSQL binary and a restart.
Sources
- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-120151
- PostgreSQL security page for CVE-2026-120151: https://www.postgresql.org/support/security/CVE-2026-120151/
- PostgreSQL 18.7, 17.12, 16.16, 15.20, 14.25 and 19 RC 2 release announcement, November 12, 2026: https://www.postgresql.org/about/news/postgresql-187-1712-1616-1520-1425-and-19-rc-2-released-3442/
- PostgreSQL 18.7 release notes: https://www.postgresql.org/docs/release/18.7/
- Fix commit in the 18 branch: https://postgr.es/c/6b1ca1333
- PostgreSQL versioning policy: https://www.postgresql.org/support/versioning/
- PostgreSQL documentation, upgrading a cluster: https://www.postgresql.org/docs/18/upgrading.html
- CVE record for CVE-2026-120150: https://www.cve.org/CVERecord?id=CVE-2026-120150
- PostgreSQL documentation, privileges: https://www.postgresql.org/docs/18/ddl-priv.html
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-120151
- CISA Known Exploited Vulnerabilities Catalog: https://www.cisa.gov/known-exploited-vulnerabilities-catalog
- FIRST EPSS score for this CVE (API): https://api.first.org/data/v1/epss?cve=CVE-2026-120151
- Red Hat CVE page: https://access.redhat.com/security/cve/CVE-2026-120151
- Debian security tracker: https://security-tracker.debian.org/tracker/CVE-2026-120151
- Ubuntu CVE page: https://ubuntu.com/security/CVE-2026-120151
- Amazon Linux Security Center: https://explore.alas.aws.amazon.com/CVE-2026-120151.html
- Docker official image for PostgreSQL: https://github.com/docker-library/postgres
- Anthropic disclosure dashboard, About: https://red.anthropic.com/2026/cvd/about/
- Anthropic, "Updating our coordinated vulnerability disclosure policy timelines", November 16, 2026: https://www.anthropic.com/research/coordinated-vulnerability-disclosure-timelines
- PostgreSQL documentation, PL/pgSQL record types: https://www.postgresql.org/docs/18/plpgsql-declarations.html
- PostgreSQL documentation, log-shipping standby servers: https://www.postgresql.org/docs/18/warm-standby.html

