agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
pgsql: Check for USAGE privilege on types used by stored expressions.
6+ messages / 1 participants
[nested] [flat]

* pgsql: Check for USAGE privilege on types used by stored expressions.
@ 2026-08-10 13:41  Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Noah Misch @ 2026-08-10 13:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Check for USAGE privilege on types used by stored expressions.

This omission allowed roles without USAGE on a type to create
stored expressions that depend on it, which could prevent the owner
from changing the type later.

The checks deliberately live in the command paths rather than the
dependency-recording routines.  Those routines also run whenever
the server re-derives an existing expression, and re-checking there
would break routine maintenance for an owner who has since lost
USAGE on a type its objects already reference.  (Checking in the
dependency-recording routines would also require additional
CommandCounterIncrement() calls to avoid spurious errors.)

The addition of a parameter to AlterDomainAddConstraint() breaks
ABI compatibility, but we are unaware of any impacted third-party
code.

Reported-by: Noah Misch <noah@leadboat.com>
Author: Nathan Bossart <nathandbossart@gmail.com>
Reviewed-by: Noah Misch <noah@leadboat.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Robert Haas <robertmhaas@gmail.com>
Security: CVE-2026-6470
Backpatch-through: 14

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4fac4c1085ab12a811f2285b189979e844ceb670
Author: Nathan Bossart <nathan@postgresql.org>

Modified Files
--------------
src/backend/catalog/dependency.c         | 76 ++++++++++++++++++++++++++++++++
src/backend/catalog/heap.c               | 22 +++++++++
src/backend/catalog/index.c              |  3 ++
src/backend/catalog/pg_attrdef.c         |  3 ++
src/backend/catalog/pg_constraint.c      |  3 ++
src/backend/catalog/pg_proc.c            |  6 +++
src/backend/catalog/pg_publication.c     |  4 ++
src/backend/catalog/pg_type.c            |  6 +++
src/backend/commands/indexcmds.c         | 16 +++++++
src/backend/commands/policy.c            |  8 ++++
src/backend/commands/propgraphcmds.c     |  7 +++
src/backend/commands/statscmds.c         |  5 +++
src/backend/commands/tablecmds.c         | 19 +++++++-
src/backend/commands/trigger.c           |  5 +++
src/backend/commands/typecmds.c          | 33 +++++++++++---
src/backend/parser/parse_utilcmd.c       | 10 +++++
src/backend/rewrite/rewriteDefine.c      |  2 +
src/backend/tcop/utility.c               |  3 +-
src/include/catalog/dependency.h         |  4 ++
src/include/commands/typecmds.h          |  3 +-
src/test/regress/expected/privileges.out | 46 +++++++++++++++++++
src/test/regress/sql/privileges.sql      | 43 ++++++++++++++++++
22 files changed, 318 insertions(+), 9 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Check for USAGE privilege on types used by stored expressions.
@ 2026-08-10 13:41  Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Noah Misch @ 2026-08-10 13:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Check for USAGE privilege on types used by stored expressions.

This omission allowed roles without USAGE on a type to create
stored expressions that depend on it, which could prevent the owner
from changing the type later.

The checks deliberately live in the command paths rather than the
dependency-recording routines.  Those routines also run whenever
the server re-derives an existing expression, and re-checking there
would break routine maintenance for an owner who has since lost
USAGE on a type its objects already reference.  (Checking in the
dependency-recording routines would also require additional
CommandCounterIncrement() calls to avoid spurious errors.)

The addition of a parameter to AlterDomainAddConstraint() breaks
ABI compatibility, but we are unaware of any impacted third-party
code.

Reported-by: Noah Misch <noah@leadboat.com>
Author: Nathan Bossart <nathandbossart@gmail.com>
Reviewed-by: Noah Misch <noah@leadboat.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Robert Haas <robertmhaas@gmail.com>
Security: CVE-2026-6470
Backpatch-through: 14

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/424fb7160bc51d55c4be2023d9238f2db8807b35
Author: Nathan Bossart <nathan@postgresql.org>

Modified Files
--------------
src/backend/catalog/dependency.c         | 76 ++++++++++++++++++++++++++++++++
src/backend/catalog/heap.c               | 22 +++++++++
src/backend/catalog/index.c              |  3 ++
src/backend/catalog/pg_attrdef.c         |  3 ++
src/backend/catalog/pg_constraint.c      |  3 ++
src/backend/catalog/pg_proc.c            |  6 +++
src/backend/catalog/pg_publication.c     |  4 ++
src/backend/catalog/pg_type.c            |  6 +++
src/backend/commands/indexcmds.c         | 16 +++++++
src/backend/commands/policy.c            |  8 ++++
src/backend/commands/propgraphcmds.c     |  7 +++
src/backend/commands/statscmds.c         |  5 +++
src/backend/commands/tablecmds.c         | 19 +++++++-
src/backend/commands/trigger.c           |  5 +++
src/backend/commands/typecmds.c          | 33 +++++++++++---
src/backend/parser/parse_utilcmd.c       | 10 +++++
src/backend/rewrite/rewriteDefine.c      |  2 +
src/backend/tcop/utility.c               |  3 +-
src/include/catalog/dependency.h         |  4 ++
src/include/commands/typecmds.h          |  3 +-
src/test/regress/expected/privileges.out | 46 +++++++++++++++++++
src/test/regress/sql/privileges.sql      | 43 ++++++++++++++++++
22 files changed, 318 insertions(+), 9 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Check for USAGE privilege on types used by stored expressions.
@ 2026-08-10 13:41  Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Noah Misch @ 2026-08-10 13:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Check for USAGE privilege on types used by stored expressions.

This omission allowed roles without USAGE on a type to create
stored expressions that depend on it, which could prevent the owner
from changing the type later.

The checks deliberately live in the command paths rather than the
dependency-recording routines.  Those routines also run whenever
the server re-derives an existing expression, and re-checking there
would break routine maintenance for an owner who has since lost
USAGE on a type its objects already reference.  (Checking in the
dependency-recording routines would also require additional
CommandCounterIncrement() calls to avoid spurious errors.)

The addition of a parameter to AlterDomainAddConstraint() breaks
ABI compatibility, but we are unaware of any impacted third-party
code.

Reported-by: Noah Misch <noah@leadboat.com>
Author: Nathan Bossart <nathandbossart@gmail.com>
Reviewed-by: Noah Misch <noah@leadboat.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Robert Haas <robertmhaas@gmail.com>
Security: CVE-2026-6470
Backpatch-through: 14

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2780538433fc3b40b4e1e7bc7cbd350e37b6d550
Author: Nathan Bossart <nathan@postgresql.org>

Modified Files
--------------
src/backend/catalog/dependency.c         | 81 ++++++++++++++++++++++++++++++++
src/backend/catalog/heap.c               | 22 +++++++++
src/backend/catalog/index.c              |  3 ++
src/backend/catalog/pg_attrdef.c         |  3 ++
src/backend/catalog/pg_constraint.c      |  3 ++
src/backend/catalog/pg_proc.c            |  6 +++
src/backend/catalog/pg_publication.c     |  4 ++
src/backend/catalog/pg_type.c            |  6 +++
src/backend/commands/indexcmds.c         | 16 +++++++
src/backend/commands/policy.c            |  8 ++++
src/backend/commands/statscmds.c         |  5 ++
src/backend/commands/tablecmds.c         | 19 +++++++-
src/backend/commands/trigger.c           |  5 ++
src/backend/commands/typecmds.c          | 33 +++++++++++--
src/backend/parser/parse_utilcmd.c       | 10 ++++
src/backend/rewrite/rewriteDefine.c      |  2 +
src/backend/tcop/utility.c               |  3 +-
src/include/catalog/dependency.h         |  4 ++
src/include/commands/typecmds.h          |  3 +-
src/test/regress/expected/privileges.out | 46 ++++++++++++++++++
src/test/regress/sql/privileges.sql      | 43 +++++++++++++++++
21 files changed, 316 insertions(+), 9 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Check for USAGE privilege on types used by stored expressions.
@ 2026-08-10 13:41  Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Noah Misch @ 2026-08-10 13:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Check for USAGE privilege on types used by stored expressions.

This omission allowed roles without USAGE on a type to create
stored expressions that depend on it, which could prevent the owner
from changing the type later.

The checks deliberately live in the command paths rather than the
dependency-recording routines.  Those routines also run whenever
the server re-derives an existing expression, and re-checking there
would break routine maintenance for an owner who has since lost
USAGE on a type its objects already reference.  (Checking in the
dependency-recording routines would also require additional
CommandCounterIncrement() calls to avoid spurious errors.)

The addition of a parameter to AlterDomainAddConstraint() breaks
ABI compatibility, but we are unaware of any impacted third-party
code.

Reported-by: Noah Misch <noah@leadboat.com>
Author: Nathan Bossart <nathandbossart@gmail.com>
Reviewed-by: Noah Misch <noah@leadboat.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Robert Haas <robertmhaas@gmail.com>
Security: CVE-2026-6470
Backpatch-through: 14

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/d1c8aa0b09f18bba1343ce2e4aa537a17a8a972f
Author: Nathan Bossart <nathan@postgresql.org>

Modified Files
--------------
src/backend/catalog/dependency.c         | 81 ++++++++++++++++++++++++++++++++
src/backend/catalog/heap.c               | 22 +++++++++
src/backend/catalog/index.c              |  3 ++
src/backend/catalog/pg_attrdef.c         |  3 ++
src/backend/catalog/pg_constraint.c      |  3 ++
src/backend/catalog/pg_proc.c            |  6 +++
src/backend/catalog/pg_publication.c     |  4 ++
src/backend/catalog/pg_type.c            |  6 +++
src/backend/commands/indexcmds.c         | 16 +++++++
src/backend/commands/policy.c            |  8 ++++
src/backend/commands/statscmds.c         |  5 ++
src/backend/commands/tablecmds.c         | 19 +++++++-
src/backend/commands/trigger.c           |  5 ++
src/backend/commands/typecmds.c          | 33 +++++++++++--
src/backend/parser/parse_utilcmd.c       | 10 ++++
src/backend/rewrite/rewriteDefine.c      |  2 +
src/backend/tcop/utility.c               |  3 +-
src/include/catalog/dependency.h         |  4 ++
src/include/commands/typecmds.h          |  3 +-
src/test/regress/expected/privileges.out | 46 ++++++++++++++++++
src/test/regress/sql/privileges.sql      | 43 +++++++++++++++++
21 files changed, 316 insertions(+), 9 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Check for USAGE privilege on types used by stored expressions.
@ 2026-08-10 13:41  Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Noah Misch @ 2026-08-10 13:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Check for USAGE privilege on types used by stored expressions.

This omission allowed roles without USAGE on a type to create
stored expressions that depend on it, which could prevent the owner
from changing the type later.

The checks deliberately live in the command paths rather than the
dependency-recording routines.  Those routines also run whenever
the server re-derives an existing expression, and re-checking there
would break routine maintenance for an owner who has since lost
USAGE on a type its objects already reference.  (Checking in the
dependency-recording routines would also require additional
CommandCounterIncrement() calls to avoid spurious errors.)

The addition of a parameter to AlterDomainAddConstraint() breaks
ABI compatibility, but we are unaware of any impacted third-party
code.

Reported-by: Noah Misch <noah@leadboat.com>
Author: Nathan Bossart <nathandbossart@gmail.com>
Reviewed-by: Noah Misch <noah@leadboat.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Robert Haas <robertmhaas@gmail.com>
Security: CVE-2026-6470
Backpatch-through: 14

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/7ce056b1798b81a287ae00e2c06f210fd0e59be2
Author: Nathan Bossart <nathan@postgresql.org>

Modified Files
--------------
src/backend/catalog/dependency.c         | 81 ++++++++++++++++++++++++++++++++
src/backend/catalog/heap.c               | 22 +++++++++
src/backend/catalog/index.c              |  3 ++
src/backend/catalog/pg_attrdef.c         |  3 ++
src/backend/catalog/pg_constraint.c      |  3 ++
src/backend/catalog/pg_proc.c            |  6 +++
src/backend/catalog/pg_publication.c     |  3 ++
src/backend/catalog/pg_type.c            |  6 +++
src/backend/commands/indexcmds.c         | 16 +++++++
src/backend/commands/policy.c            |  8 ++++
src/backend/commands/statscmds.c         |  5 ++
src/backend/commands/tablecmds.c         | 19 +++++++-
src/backend/commands/trigger.c           |  5 ++
src/backend/commands/typecmds.c          | 33 +++++++++++--
src/backend/parser/parse_utilcmd.c       | 10 ++++
src/backend/rewrite/rewriteDefine.c      |  2 +
src/backend/tcop/utility.c               |  3 +-
src/include/catalog/dependency.h         |  4 ++
src/include/commands/typecmds.h          |  3 +-
src/test/regress/expected/privileges.out | 46 ++++++++++++++++++
src/test/regress/sql/privileges.sql      | 43 +++++++++++++++++
21 files changed, 315 insertions(+), 9 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Check for USAGE privilege on types used by stored expressions.
@ 2026-08-10 13:41  Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Noah Misch @ 2026-08-10 13:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Check for USAGE privilege on types used by stored expressions.

This omission allowed roles without USAGE on a type to create
stored expressions that depend on it, which could prevent the owner
from changing the type later.

The checks deliberately live in the command paths rather than the
dependency-recording routines.  Those routines also run whenever
the server re-derives an existing expression, and re-checking there
would break routine maintenance for an owner who has since lost
USAGE on a type its objects already reference.  (Checking in the
dependency-recording routines would also require additional
CommandCounterIncrement() calls to avoid spurious errors.)

The addition of a parameter to AlterDomainAddConstraint() breaks
ABI compatibility, but we are unaware of any impacted third-party
code.

Reported-by: Noah Misch <noah@leadboat.com>
Author: Nathan Bossart <nathandbossart@gmail.com>
Reviewed-by: Noah Misch <noah@leadboat.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Robert Haas <robertmhaas@gmail.com>
Security: CVE-2026-6470
Backpatch-through: 14

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/6dbedd48b7c5024ef847572f073b94c3eed88042
Author: Nathan Bossart <nathan@postgresql.org>

Modified Files
--------------
src/backend/catalog/dependency.c         | 81 ++++++++++++++++++++++++++++++++
src/backend/catalog/heap.c               | 22 +++++++++
src/backend/catalog/index.c              |  3 ++
src/backend/catalog/pg_attrdef.c         |  3 ++
src/backend/catalog/pg_constraint.c      |  3 ++
src/backend/catalog/pg_proc.c            |  6 +++
src/backend/catalog/pg_publication.c     |  3 ++
src/backend/catalog/pg_type.c            |  6 +++
src/backend/commands/indexcmds.c         | 16 +++++++
src/backend/commands/policy.c            |  8 ++++
src/backend/commands/statscmds.c         |  5 ++
src/backend/commands/tablecmds.c         | 19 +++++++-
src/backend/commands/trigger.c           |  5 ++
src/backend/commands/typecmds.c          | 33 +++++++++++--
src/backend/parser/parse_utilcmd.c       | 10 ++++
src/backend/rewrite/rewriteDefine.c      |  2 +
src/backend/tcop/utility.c               |  3 +-
src/include/catalog/dependency.h         |  4 ++
src/include/commands/typecmds.h          |  3 +-
src/test/regress/expected/privileges.out | 46 ++++++++++++++++++
src/test/regress/sql/privileges.sql      | 43 +++++++++++++++++
21 files changed, 315 insertions(+), 9 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2026-08-10 13:41 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-08-10 13:41 pgsql: Check for USAGE privilege on types used by stored expressions. Noah Misch <noah@leadboat.com>
2026-08-10 13:41 pgsql: Check for USAGE privilege on types used by stored expressions. Noah Misch <noah@leadboat.com>
2026-08-10 13:41 pgsql: Check for USAGE privilege on types used by stored expressions. Noah Misch <noah@leadboat.com>
2026-08-10 13:41 pgsql: Check for USAGE privilege on types used by stored expressions. Noah Misch <noah@leadboat.com>
2026-08-10 13:41 pgsql: Check for USAGE privilege on types used by stored expressions. Noah Misch <noah@leadboat.com>
2026-08-10 13:41 pgsql: Check for USAGE privilege on types used by stored expressions. Noah Misch <noah@leadboat.com>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox