Oriel — AI & technology worth noticing, every day.

How I Ended Up Turning a 22-Year-Old PostgreSQL Type-Confusion Primitive into RCE (CVE-2026-6460)

Web page · https://mehmetince.net/part-3-6-how-i-ended-up-turning-a-22-year-old-postgresql-type-confusion-primitive-into-rce-cve-2026-6460

First seen by Oriel on .

AI summary

This article traces the discovery of PostgreSQL type-confusion vulnerability CVE-2026-6460, where altering a composite type after preparation causes controlled data to reach incompatible native consumers and enables memory corruption.

  • The research began with a pg_clickhouse conversion bug, which prompted investigation of PostgreSQL’s Datum representation, type OIDs, and input/output functions.
  • A Datum carries generic data without identifying its type; PostgreSQL selects interpretation through metadata such as consttype and pg_type properties.
  • Using LANGUAGE internal, the author deliberately passed an integer to textout, demonstrating that mismatched native consumers can crash a PostgreSQL backend.
  • The core primitive uses a prepared query referencing a composite type initially containing UUID, then changes its attribute to bytea before execution, producing a segmentation fault.
  • The issue is triggered by a lowest-privileged login role and may affect PostgreSQL-compatible managed database offerings, according to the article.

#postgresql #type confusion #memory corruption #managed databases

Generated by gpt-5.6-sol. Check the original for details.

Metric trends

Last 30 days · Up to 120 recorded samples per source and metric, with reposts kept separate · First and latest retained

Points

Score reported by the source.

  • Hacker News: 228, latest observation ; +218 over observed period since
  • Lobsters: 1, latest observation ; 0 over observed period since

Comments

Comment count reported by the source.

  • Hacker News: 40, latest observation ; +40 over observed period since
  • Lobsters: 1, latest observation ; 0 over observed period since

Aliases

SourceExternal IDURL
Hacker News50471761https://mehmetince.net/part-3-6-how-i-ended-up-turning-a-22-year-old-postgresql-type-confusion-primitive-into-rce-cve-2026-6460/ Read discussion
Lobstersnlpvckhttps://mehmetince.net/part-3-6-how-i-ended-up-turning-a-22-year-old-postgresql-type-confusion-primitive-into-rce-cve-2026-6460/ Read discussion