-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PG-417: Replace 'CREATE OR REPLACE' with 'CREATE' for extension.
While analyzing the pg_stat_monitor installation scripts I found several vulnerabilities. pg_stat_monitor uses CREATE OR REPLACE to install its functions which is a security hazard. An attacker can precreate the functions have a superuser install the extension and after installation the attacker can switch out the function with a malicious version since he would still be the owner of the function. Instead of CREATE OR REPLACE the installation script should use plain CREATE to prevent this attack. For reference https://www.postgresql.org/docs/current/extend-extensions.html#EXTEND-EXTENSIONS-SECURITY https://github.com/timescale/pgspot
- Loading branch information
Ibrar Ahmed
committed
May 22, 2022
1 parent
455d39d
commit 1b995c7
Showing
3 changed files
with
9 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters