Re: pg18: Virtual generated columns are not (yet) safe when superuser selects from them
Bruce Momjian <bruce@momjian.us>
From: Bruce Momjian <bruce@momjian.us>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Feike Steenbergen <feikesteenbergen@gmail.com>, Robert Haas <robertmhaas@gmail.com>, jian he <jian.universality@gmail.com>, "David G. Johnston" <david.g.johnston@gmail.com>, PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
Date: 2025-05-29T23:32:01Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Restrict virtual columns to use built-in functions and types
- 0cd69b3d7ef3 18.0 landed
-
Fix virtual generated column type checking for ALTER TABLE
- 49fe1c83ecf3 18.0 landed
-
Expand virtual generated columns in the planner
- 1e4351af329f 18.0 cited
On Thu, May 29, 2025 at 02:15:22PM -0400, Tom Lane wrote: > Feike Steenbergen <feikesteenbergen@gmail.com> writes: > > pg_restore may have issues though, as it will run these functions > > for GENERATED STORED columns? > > pg_restore is already fairly exposed, as it will run tables' CHECK > constraints, index expressions, etc. I don't think GENERATED STORED > makes that picture much worse. > > As Robert said upthread, it would be nice to make all this more > secure. But it'd presumably involve user-visible semantics changes > along with the performance worries I mentioned. It's a dauntingly > large task... I spent some time thinking about the above email. First, this is on the public hackers list, so it explains known security deficiencies. Do we document these somewhere? I don't see them in the pg_dump or pg_restore manual pages. Second, I agree adding a SELECT security deficiency is certainly worse, but how are we expecting people to restore databases securely with these known deficiencies? Effectively, what good is our security system if it is just delaying someone from getting superuser privileges in case of a dump/restore? (Yeah, that's me, Mr. Sunshine. ;-) ) -- Bruce Momjian <bruce@momjian.us> https://momjian.us EDB https://enterprisedb.com Do not let urgent matters crowd out time for investment in the future.