Fix priv checks for ALTER <object> DEPENDS ON EXTENSION

Alvaro Herrera <alvherre@alvh.no-ip.org>

Commit: 2ad125322d5be8b264f2b0945d7dd23ba3ace60e
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: 2020-02-10T14:47:09Z
Releases: 12.2
Fix priv checks for ALTER <object> DEPENDS ON EXTENSION

Marking an object as dependant on an extension did not have any
privilege check whatsoever; this allowed any user to mark objects as
droppable by anyone able to DROP EXTENSION, which could be used to cause
system-wide havoc.  Disallow by checking that the calling user owns the
mentioned object.

(No constraints are placed on the extension.)

Security: CVE-2020-1720
Reported-by: Tom Lane
Discussion: 31605.1566429043@sss.pgh.pa.us

Files

PathChange+/−
src/backend/commands/alter.c modified +11 −0