Skip to content

Commit 4bed8ac

Browse files
committed
Unset PG_CIPHER_KEY environment variable to prevent access to it by non-priveleged users through pgperl
1 parent 879707f commit 4bed8ac

File tree

1 file changed

+1
-0
lines changed
  • src/backend/storage/file

1 file changed

+1
-0
lines changed

src/backend/storage/file/cfs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ static void cfs_rc4_init(void)
238238
if (cipher_key == NULL) {
239239
elog(ERROR, "PG_CIPHER_KEY environment variable is not set");
240240
}
241+
unsetenv("PG_CIPHER_KEY"); /* make it not possible to inspect this environment variable through plperl */
241242
key_length = strlen(cipher_key);
242243
for (i = 0; i < CFS_CIPHER_KEY_SIZE; ++i) {
243244
rc4_init_state[i] = (uint8)i;

0 commit comments

Comments
 (0)