The remote Redhat Enterprise Linux 5 host has one or more packages installed that are affected by multiple vulnerabilities that have been acknowledged by the vendor but will not be patched.
postgresql: Improper randomization of pgcrypto functions (requiring random seed) (CVE-2013-1900)
postgresql: Empty password accepted in some authentication methods (CVE-2017-7546)
PostgreSQL before 9.1.23, 9.2.x before 9.2.18, 9.3.x before 9.3.14, 9.4.x before 9.4.9, and 9.5.x before 9.5.4 allow remote authenticated users to cause a denial of service (NULL pointer dereference and server crash), obtain sensitive memory information, or possibly execute arbitrary code via (1) a CASE expression within the test value subexpression of another CASE or (2) inlining of an SQL function that implements the equality operator used for a CASE expression involving values of different types. (CVE-2016-5423)
PostgreSQL before 9.1.23, 9.2.x before 9.2.18, 9.3.x before 9.3.14, 9.4.x before 9.4.9, and 9.5.x before 9.5.4 might allow remote authenticated users with the CREATEDB or CREATEROLE role to gain superuser privileges via a (1) (double quote), (2) \ (backslash), (3) carriage return, or (4) newline character in a (a) database or (b) role name that is mishandled during an administrative operation. (CVE-2016-5424)
PostgreSQL 10.x before 10.1, 9.6.x before 9.6.6, 9.5.x before 9.5.10, 9.4.x before 9.4.15, 9.3.x before 9.3.20, and 9.2.x before 9.2.24 runs under a non-root operating system account, and database superusers have effective ability to run arbitrary code under that system account. PostgreSQL provides a script for starting the database server during system boot. Packages of PostgreSQL for many operating systems provide their own, packager-authored startup implementations. Several implementations use a log file name that the database superuser can replace with a symbolic link. As root, they open(), chmod() and/or chown() this log file name. This often suffices for the database superuser to escalate to root privileges when root starts the server. (CVE-2017-12172)
Privilege escalation flaws were found in the Red Hat initialization scripts of PostgreSQL. An attacker with access to the postgres user account could use these flaws to obtain root access on the server machine. (CVE-2017-15097)
It was found that some selectivity estimation functions in PostgreSQL before 9.2.21, 9.3.x before 9.3.17, 9.4.x before 9.4.12, 9.5.x before 9.5.7, and 9.6.x before 9.6.3 did not check user privileges before providing information from pg_statistic, possibly leaking information. An unprivileged attacker could use this flaw to steal some information from tables they are otherwise not allowed to access. (CVE-2017-7484)
PostgreSQL versions 8.4 - 9.6 are vulnerable to information leak in pg_user_mappings view which discloses foreign server passwords to any user having USAGE privilege on the associated foreign server.
(CVE-2017-7486)
A flaw was found in the way Postgresql allowed a user to modify the behavior of a query for other users.
An attacker with a user account could use this flaw to execute code with the permissions of superuser in the database. Versions 9.3 through 10 are affected. (CVE-2018-1058)
A flaw was discovered in postgresql versions 9.4.x before 9.4.24, 9.5.x before 9.5.19, 9.6.x before 9.6.15, 10.x before 10.10 and 11.x before 11.5 where arbitrary SQL statements can be executed given a suitable SECURITY DEFINER function. An attacker, with EXECUTE permission on the function, can execute arbitrary SQL as the owner of the function. (CVE-2019-10208)
It was found that some PostgreSQL extensions did not use search_path safely in their installation script.
An attacker with sufficient privileges could use this flaw to trick an administrator into executing a specially crafted script, during the installation or update of such extension. This affects PostgreSQL versions before 12.4, before 11.9, before 10.14, before 9.6.19, and before 9.5.23. (CVE-2020-14350)
A flaw was found in PostgreSQL versions before 13.1, before 12.5, before 11.10, before 10.15, before 9.6.20 and before 9.5.24. If a client application that creates additional database connections only reuses the basic connection parameters while dropping security-relevant parameters, an opportunity for a man-in- the-middle attack, or the ability to observe clear-text transmissions, could exist. The highest threat from this vulnerability is to data confidentiality and integrity as well as system availability.
(CVE-2020-25694)
A flaw was found in PostgreSQL versions before 13.1, before 12.5, before 11.10, before 10.15, before 9.6.20 and before 9.5.24. An attacker having permission to create non-temporary objects in at least one schema can execute arbitrary SQL functions under the identity of a superuser. The highest threat from this vulnerability is to data confidentiality and integrity as well as system availability. (CVE-2020-25695)
A flaw was found in the psql interactive terminal of PostgreSQL in versions before 13.1, before 12.5, before 11.10, before 10.15, before 9.6.20 and before 9.5.24. If an interactive psql session uses \gset when querying a compromised server, the attacker can execute arbitrary code as the operating system account running psql. The highest threat from this vulnerability is to data confidentiality and integrity as well as system availability. (CVE-2020-25696)
When the server is configured to use trust authentication with a clientcert requirement or to use cert authentication, a man-in-the-middle attacker can inject arbitrary SQL queries when a connection is first established, despite the use of SSL certificate verification and encryption. (CVE-2021-23214)
A man-in-the-middle attacker can inject false responses to the client’s first few queries, despite the use of SSL certificate verification and encryption. (CVE-2021-23222)
Note that Nessus has not tested for these issues but has instead relied on the package manager’s report that the package is installed.
#%NASL_MIN_LEVEL 80900
##
# (C) Tenable, Inc.
#
# The descriptive text and package checks in this plugin were
# extracted from Red Hat Security Advisory postgresql. The text
# itself is copyright (C) Red Hat, Inc.
##
include('compat.inc');
if (description)
{
script_id(195404);
script_version("1.0");
script_set_attribute(attribute:"plugin_modification_date", value:"2024/05/11");
script_cve_id(
"CVE-2013-1900",
"CVE-2016-5423",
"CVE-2016-5424",
"CVE-2017-7484",
"CVE-2017-7486",
"CVE-2017-7546",
"CVE-2017-12172",
"CVE-2017-15097",
"CVE-2018-1058",
"CVE-2019-10208",
"CVE-2020-14350",
"CVE-2020-25694",
"CVE-2020-25695",
"CVE-2020-25696",
"CVE-2021-23214",
"CVE-2021-23222"
);
script_name(english:"RHEL 5 : postgresql (Unpatched Vulnerability)");
script_set_attribute(attribute:"synopsis", value:
"The remote Red Hat 5 host is affected by multiple vulnerabilities that will not be patched.");
script_set_attribute(attribute:"description", value:
"The remote Redhat Enterprise Linux 5 host has one or more packages installed that are affected by multiple
vulnerabilities that have been acknowledged by the vendor but will not be patched.
- postgresql: Improper randomization of pgcrypto functions (requiring random seed) (CVE-2013-1900)
- postgresql: Empty password accepted in some authentication methods (CVE-2017-7546)
- PostgreSQL before 9.1.23, 9.2.x before 9.2.18, 9.3.x before 9.3.14, 9.4.x before 9.4.9, and 9.5.x before
9.5.4 allow remote authenticated users to cause a denial of service (NULL pointer dereference and server
crash), obtain sensitive memory information, or possibly execute arbitrary code via (1) a CASE expression
within the test value subexpression of another CASE or (2) inlining of an SQL function that implements the
equality operator used for a CASE expression involving values of different types. (CVE-2016-5423)
- PostgreSQL before 9.1.23, 9.2.x before 9.2.18, 9.3.x before 9.3.14, 9.4.x before 9.4.9, and 9.5.x before
9.5.4 might allow remote authenticated users with the CREATEDB or CREATEROLE role to gain superuser
privileges via a (1) (double quote), (2) \ (backslash), (3) carriage return, or (4) newline character in
a (a) database or (b) role name that is mishandled during an administrative operation. (CVE-2016-5424)
- PostgreSQL 10.x before 10.1, 9.6.x before 9.6.6, 9.5.x before 9.5.10, 9.4.x before 9.4.15, 9.3.x before
9.3.20, and 9.2.x before 9.2.24 runs under a non-root operating system account, and database superusers
have effective ability to run arbitrary code under that system account. PostgreSQL provides a script for
starting the database server during system boot. Packages of PostgreSQL for many operating systems provide
their own, packager-authored startup implementations. Several implementations use a log file name that the
database superuser can replace with a symbolic link. As root, they open(), chmod() and/or chown() this log
file name. This often suffices for the database superuser to escalate to root privileges when root starts
the server. (CVE-2017-12172)
- Privilege escalation flaws were found in the Red Hat initialization scripts of PostgreSQL. An attacker
with access to the postgres user account could use these flaws to obtain root access on the server
machine. (CVE-2017-15097)
- It was found that some selectivity estimation functions in PostgreSQL before 9.2.21, 9.3.x before 9.3.17,
9.4.x before 9.4.12, 9.5.x before 9.5.7, and 9.6.x before 9.6.3 did not check user privileges before
providing information from pg_statistic, possibly leaking information. An unprivileged attacker could use
this flaw to steal some information from tables they are otherwise not allowed to access. (CVE-2017-7484)
- PostgreSQL versions 8.4 - 9.6 are vulnerable to information leak in pg_user_mappings view which discloses
foreign server passwords to any user having USAGE privilege on the associated foreign server.
(CVE-2017-7486)
- A flaw was found in the way Postgresql allowed a user to modify the behavior of a query for other users.
An attacker with a user account could use this flaw to execute code with the permissions of superuser in
the database. Versions 9.3 through 10 are affected. (CVE-2018-1058)
- A flaw was discovered in postgresql versions 9.4.x before 9.4.24, 9.5.x before 9.5.19, 9.6.x before
9.6.15, 10.x before 10.10 and 11.x before 11.5 where arbitrary SQL statements can be executed given a
suitable SECURITY DEFINER function. An attacker, with EXECUTE permission on the function, can execute
arbitrary SQL as the owner of the function. (CVE-2019-10208)
- It was found that some PostgreSQL extensions did not use search_path safely in their installation script.
An attacker with sufficient privileges could use this flaw to trick an administrator into executing a
specially crafted script, during the installation or update of such extension. This affects PostgreSQL
versions before 12.4, before 11.9, before 10.14, before 9.6.19, and before 9.5.23. (CVE-2020-14350)
- A flaw was found in PostgreSQL versions before 13.1, before 12.5, before 11.10, before 10.15, before
9.6.20 and before 9.5.24. If a client application that creates additional database connections only reuses
the basic connection parameters while dropping security-relevant parameters, an opportunity for a man-in-
the-middle attack, or the ability to observe clear-text transmissions, could exist. The highest threat
from this vulnerability is to data confidentiality and integrity as well as system availability.
(CVE-2020-25694)
- A flaw was found in PostgreSQL versions before 13.1, before 12.5, before 11.10, before 10.15, before
9.6.20 and before 9.5.24. An attacker having permission to create non-temporary objects in at least one
schema can execute arbitrary SQL functions under the identity of a superuser. The highest threat from this
vulnerability is to data confidentiality and integrity as well as system availability. (CVE-2020-25695)
- A flaw was found in the psql interactive terminal of PostgreSQL in versions before 13.1, before 12.5,
before 11.10, before 10.15, before 9.6.20 and before 9.5.24. If an interactive psql session uses \gset
when querying a compromised server, the attacker can execute arbitrary code as the operating system
account running psql. The highest threat from this vulnerability is to data confidentiality and integrity
as well as system availability. (CVE-2020-25696)
- When the server is configured to use trust authentication with a clientcert requirement or to use cert
authentication, a man-in-the-middle attacker can inject arbitrary SQL queries when a connection is first
established, despite the use of SSL certificate verification and encryption. (CVE-2021-23214)
- A man-in-the-middle attacker can inject false responses to the client's first few queries, despite the use
of SSL certificate verification and encryption. (CVE-2021-23222)
Note that Nessus has not tested for these issues but has instead relied on the package manager's report that the package
is installed.");
script_set_attribute(attribute:"solution", value:
"The vendor has acknowledged the vulnerabilities but no solution has been provided. Refer to the vendor for remediation
guidance.");
script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:S/C:C/I:C/A:C");
script_set_cvss_temporal_vector("CVSS2#E:U/RL:OF/RC:C");
script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H");
script_set_cvss3_temporal_vector("CVSS:3.0/E:U/RL:O/RC:C");
script_set_attribute(attribute:"cvss_score_source", value:"CVE-2013-1900");
script_set_attribute(attribute:"cvss3_score_source", value:"CVE-2017-7546");
script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available");
script_set_attribute(attribute:"exploit_available", value:"false");
script_set_attribute(attribute:"vendor_unpatched", value:"true");
script_set_attribute(attribute:"vuln_publication_date", value:"2013/04/04");
script_set_attribute(attribute:"plugin_publication_date", value:"2024/05/11");
script_set_attribute(attribute:"plugin_type", value:"local");
script_set_attribute(attribute:"cpe", value:"cpe:/o:redhat:enterprise_linux:5");
script_set_attribute(attribute:"cpe", value:"cpe:/o:redhat:enterprise_linux:6");
script_set_attribute(attribute:"cpe", value:"cpe:/o:redhat:enterprise_linux:7");
script_set_attribute(attribute:"cpe", value:"cpe:/o:redhat:enterprise_linux:8");
script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:postgresql");
script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:postgresql84");
script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:rh-postgresql95-postgresql");
script_set_attribute(attribute:"generated_plugin", value:"current");
script_end_attributes();
script_category(ACT_GATHER_INFO);
script_family(english:"Red Hat Local Security Checks");
script_copyright(english:"This script is Copyright (C) 2024 and is owned by Tenable, Inc. or an Affiliate thereof.");
script_dependencies("ssh_get_info.nasl", "redhat_repos.nasl");
script_require_keys("Host/local_checks_enabled", "Host/RedHat/release", "Host/RedHat/rpm-list", "Host/cpu");
exit(0);
}
include('rpm.inc');
include('rhel.inc');
if (!get_kb_item("global_settings/vendor_unpatched"))
exit(0, "Unpatched Vulnerabilities Detection not active.");
if (!get_kb_item('Host/local_checks_enabled')) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
var os_release = get_kb_item('Host/RedHat/release');
if (isnull(os_release) || 'Red Hat' >!< os_release) audit(AUDIT_OS_NOT, 'Red Hat');
var os_ver = pregmatch(pattern: "Red Hat Enterprise Linux.*release ([0-9]+(\.[0-9]+)?)", string:os_release);
if (isnull(os_ver)) audit(AUDIT_UNKNOWN_APP_VER, 'Red Hat');
os_ver = os_ver[1];
if (!rhel_check_release(operator: 'ge', os_version: os_ver, rhel_version: '5')) audit(AUDIT_OS_NOT, 'Red Hat 5.x', 'Red Hat ' + os_ver);
if (!get_kb_item('Host/RedHat/rpm-list')) audit(AUDIT_PACKAGE_LIST_MISSING);
var cpu = get_kb_item('Host/cpu');
if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);
if ('x86_64' >!< cpu && cpu !~ "^i[3-6]86$" && 's390' >!< cpu && 'aarch64' >!< cpu && 'ppc' >!< cpu) audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, 'Red Hat', cpu);
var constraints = [
{
'pkgs': [
{'reference':'postgresql', 'release':'5', 'rpm_spec_vers_cmp':TRUE, 'unpatched_pkg':'postgresql', 'cves':['CVE-2013-1900', 'CVE-2016-5423', 'CVE-2016-5424', 'CVE-2017-7484', 'CVE-2017-7546', 'CVE-2017-12172', 'CVE-2017-15097', 'CVE-2018-1058', 'CVE-2019-10208', 'CVE-2020-14350', 'CVE-2020-25694', 'CVE-2020-25695', 'CVE-2020-25696', 'CVE-2021-23214', 'CVE-2021-23222']},
{'reference':'postgresql84', 'release':'5', 'rpm_spec_vers_cmp':TRUE, 'unpatched_pkg':'postgresql84', 'cves':['CVE-2016-5423', 'CVE-2016-5424', 'CVE-2017-7484', 'CVE-2017-7486', 'CVE-2017-7546', 'CVE-2017-12172', 'CVE-2017-15097', 'CVE-2018-1058', 'CVE-2020-14350', 'CVE-2020-25694', 'CVE-2020-25695', 'CVE-2020-25696']}
]
}
];
var flag = 0;
foreach var constraint_array ( constraints ) {
var repo_relative_urls = NULL;
var enterprise_linux_flag = rhel_repo_urls_has_content_dist_rhel(repo_urls:repo_relative_urls);
foreach var pkg ( constraint_array['pkgs'] ) {
var unpatched_pkg = NULL;
var _release = NULL;
var sp = NULL;
var el_string = NULL;
var rpm_spec_vers_cmp = NULL;
var exists_check = NULL;
var cves = NULL;
if (!empty_or_null(pkg['unpatched_pkg'])) unpatched_pkg = pkg['unpatched_pkg'];
if (!empty_or_null(pkg['release'])) _release = 'RHEL' + pkg['release'];
if (!empty_or_null(pkg['sp'])) sp = pkg['sp'];
if (!empty_or_null(pkg['rpm_spec_vers_cmp'])) rpm_spec_vers_cmp = pkg['rpm_spec_vers_cmp'];
if (!empty_or_null(pkg['exists_check'])) exists_check = pkg['exists_check'];
if (!empty_or_null(pkg['cves'])) cves = pkg['cves'];
if (unpatched_pkg &&
_release &&
(!exists_check || rpm_exists(release:_release, rpm:exists_check)) &&
unpatched_package_exists(release:_release, package:unpatched_pkg, cves: cves)) flag++;
}
}
if (flag)
{
var extra = NULL;
security_report_v4(
port : 0,
severity : SECURITY_HOLE,
extra : unpatched_packages_report()
);
exit(0);
}
else
{
var tested = pkg_tests_get();
if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
else audit(AUDIT_PACKAGE_NOT_INSTALLED, 'postgresql / postgresql84');
}
Vendor | Product | Version | CPE |
---|---|---|---|
redhat | enterprise_linux | 5 | cpe:/o:redhat:enterprise_linux:5 |
redhat | enterprise_linux | 6 | cpe:/o:redhat:enterprise_linux:6 |
redhat | enterprise_linux | 7 | cpe:/o:redhat:enterprise_linux:7 |
redhat | enterprise_linux | 8 | cpe:/o:redhat:enterprise_linux:8 |
redhat | enterprise_linux | postgresql | p-cpe:/a:redhat:enterprise_linux:postgresql |
redhat | enterprise_linux | postgresql84 | p-cpe:/a:redhat:enterprise_linux:postgresql84 |
redhat | enterprise_linux | rh-postgresql95-postgresql | p-cpe:/a:redhat:enterprise_linux:rh-postgresql95-postgresql |
cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-1900
cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-5423
cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-5424
cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-12172
cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-15097
cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-7484
cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-7486
cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-7546
cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-1058
cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-10208
cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14350
cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-25694
cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-25695
cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-25696
cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-23214
cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-23222