diff options
author | Noah Misch <noah@leadboat.com> | 2016-02-05 20:22:51 -0500 |
---|---|---|
committer | Noah Misch <noah@leadboat.com> | 2016-02-05 20:23:19 -0500 |
commit | b1f591c50e3bd359c610e59dfbd3787c00ac191e (patch) | |
tree | 9fff28290ce6af945c6121db1820980f662c5662 /src/backend/utils/misc/guc.c | |
parent | 6887d72d06a2f36508d5be9cca316088d4c60b26 (diff) |
Force certain "pljava" custom GUCs to be PGC_SUSET.
Future PL/Java versions will close CVE-2016-0766 by making these GUCs
PGC_SUSET. This PostgreSQL change independently mitigates that PL/Java
vulnerability, helping sites that update PostgreSQL more frequently than
PL/Java. Back-patch to 9.1 (all supported versions).
Diffstat (limited to 'src/backend/utils/misc/guc.c')
-rw-r--r-- | src/backend/utils/misc/guc.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index b9b6b2053fe..517b92db581 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -6297,6 +6297,17 @@ init_custom_variable(const char *name, !process_shared_preload_libraries_in_progress) elog(FATAL, "cannot create PGC_POSTMASTER variables after startup"); + /* + * Before pljava commit 398f3b876ed402bdaec8bc804f29e2be95c75139 + * (2015-12-15), two of that module's PGC_USERSET variables facilitated + * trivial escalation to superuser privileges. Restrict the variables to + * protect sites that have yet to upgrade pljava. + */ + if (context == PGC_USERSET && + (strcmp(name, "pljava.classpath") == 0 || + strcmp(name, "pljava.vmoptions") == 0)) + context = PGC_SUSET; + gen = (struct config_generic *) guc_malloc(ERROR, sz); memset(gen, 0, sz); |