Here’s the take you’ll see everywhere this week: it needs a database login, so calm down, schedule it for the next maintenance window. And here’s why that reading will get a few people owned by spring, the credential barrier is lower than it sounds, and the package manager did not finish the job for you.
The PostgreSQL project shipped updates yesterday closing 52 security issues. The headline one is a type confusion flaw in object creation that has apparently been sitting in the tree for around 22 years. An authenticated user who can create objects can turn that into code execution as the operating-system account running the server, usually postgres. Not SQL injection. Not “read a table you shouldn’t.” Shell-adjacent code running as the service account, with whatever filesystem and network access that account has.
If the advisory cites a specific CVE for this one, use the number from the official PostgreSQL security page, I’m not going to invent an identifier to make this read more authoritative. Describe it to your change board as “type confusion during object creation leading to server-side code execution” and nobody will argue with you.
Steelmanning the “relax, it’s authenticated” crowd
Let me give the calm reading its due, because it isn’t stupid. This is not an internet-facing, unauthenticated, wormable bug. The attacker needs a valid login and the privilege to create objects in some schema. A tightly run shop where every application role is scoped to SELECT/INSERT/UPDATE on specific tables, where nobody but DBAs can CREATE, where 5432 is firewalled to app subnets, that shop has a real, meaningful barrier in front of this. CVSS vector math will reflect that. The people telling you it’s not a drop-everything internet emergency are correct on the narrow point.
Now the part they’re skating past.
“Authenticated” assumes the authentication actually means something. In the real estate I audit, it frequently doesn’t:
- The application role is also the schema owner, because the migration tool needed
CREATEand nobody walked it back. Create-object privilege is normal for ORMs that manage their own DDL. - The connection string with that role’s password is in an environment variable, a
.envfile, a CI secret, a container image layer, and three developers’ laptops. - Service-account credentials are shared across environments and rotate never. “Only authenticated” is one SSRF, one leaked repo, or one phished developer away from “authenticated as the app.”
So the honest severity read is: low complexity, high impact, and a precondition that a determined attacker already has halfway to met on most networks. That’s a patch-this-week bug, not a patch-this-quarter bug. It is also not, I’ll grant the calmer voices, a tonight-at-2am-wake-the-oncall bug if your create-object privilege is genuinely locked down and your network exposure is genuinely zero. Few people can say that honestly.
The sentence in the advisory nobody reads
This is the part that actually moves me to write. Updating the PostgreSQL server packages and restarting is step one of two. For full protection you very likely need to rebuild any C-language extensions against the patched server, because the fix touches internals that compiled extension code links against. Core update alone leaves a gap if you run C extensions, and a lot of you do without thinking of them as extensions.
This is the lesson the industry relearns every few years and acts surprised by: your database is not just the server binary. It’s the server binary plus every .so that gets loaded into its address space. PostGIS, pg_stat_statements, pgvector, citus, timescaledb, pg_cron, that one bespoke extension a contractor wrote in 2019, all C code running inside the server process. Patch the core, leave the old extensions in place, and you’ve repainted the front door while leaving the side window open.
If you’re on managed Postgres, RDS, Cloud SQL, Azure Database, the provider owns both steps, but on their schedule, not yours. Check the provider’s maintenance notice for the patched minor version and whether a restart or extension refresh is required on your side. “Managed” means someone else does the work, not that the work is already done.
Find every instance before you argue about severity
You cannot patch what you can’t see, and the PostgreSQL you forgot about is the one that gets you. Containers, a dev box someone promoted to “temporarily” prod, an embedded instance inside a vendor appliance. Start by enumerating. Read-only, no changes:
Once you have a host, ask each instance what version it is and, the bit that matters, which C extensions are loaded. Run this against every database, not just postgres; extensions live per-database:
Any row from that second query means you have compiled C running inside the server, and that instance needs the rebuild step after the core update. An empty result across every database is the one case where a core update and restart genuinely finishes the job. To cross-check on the filesystem:
Check the modification dates. If your .so files are older than the server binary you just installed, you have the gap.
What to actually do, in order
- Update PostgreSQL core to the patched minor release for your major version. Patched releases have been issued, get the exact version numbers for your major version from the official PostgreSQL release notes rather than trusting a number from a blog (including mine). Restart the service.
- Rebuild C-language extensions against the patched server. For distro-packaged extensions (
postgresql-NN-postgis,-pgvector, etc.) that means updating those packages from the same repo in the same pass. For anything built from source, recompile against the new headers and reinstall the.so. Then restart again and re-run the C-function query above to confirm the objects point at freshly built binaries. - Compensating controls while you schedule, not instead of patching: revoke
CREATEonpublicand application schemas from roles that don’t need DDL (REVOKE CREATE ON SCHEMA public FROM app_role;), confirm 5432 is firewalled to known app sources only, and rotate any service-account credentials you can’t vouch for. These shrink the “authenticated user who can create objects” population, which is the whole precondition for the headline bug.
The other 51 fixes aren’t nothing either, but the type-confusion RCE plus the extension-rebuild requirement is the combination that turns “we patched” into a false statement on the change ticket.
Patch this week. And when you close the ticket, don’t write “updated and restarted.” Write “updated, extensions rebuilt, C-function audit clean.” If you can’t write the second half honestly, you’re not done, you just think you are.
