mirror of
https://github.com/postgres/postgres.git
synced 2025-12-19 17:02:53 +03:00
Check for CREATE privilege on the schema in CREATE STATISTICS.
This omission allowed table owners to create statistics in any schema, potentially leading to unexpected naming conflicts. For ALTER TABLE commands that require re-creating statistics objects, skip this check in case the user has since lost CREATE on the schema. The addition of a second parameter to CreateStatistics() breaks ABI compatibility, but we are unaware of any impacted third-party code. Reported-by: Jelte Fennema-Nio <postgres@jeltef.nl> Author: Jelte Fennema-Nio <postgres@jeltef.nl> Co-authored-by: Nathan Bossart <nathandbossart@gmail.com> Reviewed-by: Noah Misch <noah@leadboat.com> Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de> Security: CVE-2025-12817 Backpatch-through: 13
This commit is contained in:
@@ -9680,7 +9680,7 @@ ATExecAddStatistics(AlteredTableInfo *tab, Relation rel,
|
||||
/* The CreateStatsStmt has already been through transformStatsStmt */
|
||||
Assert(stmt->transformed);
|
||||
|
||||
address = CreateStatistics(stmt);
|
||||
address = CreateStatistics(stmt, !is_rebuild);
|
||||
|
||||
return address;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user