Vulnerabilities > CVE-2019-10128 - Improper Access Control vulnerability in Postgresql

047910
CVSS 7.8 - HIGH
Attack vector
LOCAL
Attack complexity
LOW
Privileges required
LOW
Confidentiality impact
HIGH
Integrity impact
HIGH
Availability impact
HIGH
local
low complexity
postgresql
CWE-284
nessus

Summary

A vulnerability was found in postgresql versions 11.x prior to 11.3. The Windows installer for EnterpriseDB-supplied PostgreSQL does not lock down the ACL of the binary installation directory or the ACL of the data directory; it keeps the inherited ACL. In the default configuration, this allows a local attacker to read arbitrary data directory files, essentially bypassing database-imposed read access limitations. In plausible non-default configurations, an attacker having both an unprivileged Windows account and an unprivileged PostgreSQL account can cause the PostgreSQL service account to execute arbitrary code.

Vulnerable Configurations

Part Description Count
Application
Postgresql
391
OS
Microsoft
1

Common Weakness Enumeration (CWE)

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Embedding Scripts within Scripts
    An attack of this type exploits a programs' vulnerabilities that are brought on by allowing remote hosts to execute scripts. The attacker leverages this capability to execute scripts to execute his/her own script by embedding it within other scripts that the target software is likely to execute. The attacker must have the ability to inject script into script that is likely to be executed. If this is done, then the attacker can potentially launch a variety of probes and attacks against the web server's local environment, in many cases the so-called DMZ, back end resources the web server can communicate with, and other hosts. With the proliferation of intermediaries, such as Web App Firewalls, network devices, and even printers having JVMs and Web servers, there are many locales where an attacker can inject malicious scripts. Since this attack pattern defines scripts within scripts, there are likely privileges to execute said attack on the host. Of course, these attacks are not solely limited to the server side, client side scripts like Ajax and client side JavaScript can contain malicious scripts as well. In general all that is required is for there to be sufficient privileges to execute a script, but not protected against writing.
  • Signature Spoofing by Key Theft
    An attacker obtains an authoritative or reputable signer's private signature key by theft and then uses this key to forge signatures from the original signer to mislead a victim into performing actions that benefit the attacker.

Nessus

NASL familyDatabases
NASL idPOSTGRESQL_20190509.NASL
descriptionThe version of PostgreSQL installed on the remote host is 9.4.x prior to 9.4.22, 9.5.x prior to 9.5.17, 9.6.x prior to 9.6.13, 10.x prior to 10.8, or 11.x prior to 11.3. It is, therefore, affected by multiple vulnerabilities. - A remote code execution vulnerability exists in both, the BigSQL and the EnterpriseDB Windows installers due to the installers not locking down the permissions of the PostgreSQL binary installation directory and the data directory. An authenticated, local attacker can exploit this, to cause the PostgreSQL service account to execute arbitrary code. (CVE-2019-10127, CVE-2019-10128) - A memory disclosure vulnerability exists in the partition routing component. An authenticated, remote attacker can exploit this, via the execution of a crafted INSERT statement to a partitioned table to disclose memory contents. (CVE-2019-10129) - A security bypass vulnerability exists in the core server. An authenticated, remote attacker can exploit this, via the execution of a crafted SQL query with a leaky operator to disclose potentially sensitive information. (CVE-2019-10130)
last seen2020-06-01
modified2020-06-02
plugin id125264
published2019-05-17
reporterThis script is Copyright (C) 2019 and is owned by Tenable, Inc. or an Affiliate thereof.
sourcehttps://www.tenable.com/plugins/nessus/125264
titlePostgreSQL 9.4.x < 9.4.22 / 9.5.x < 9.5.17 / 9.6.x < 9.6.13 / 10.x < 10.8 / 11.x < 11.3 Multiple vulnerabilities
code
#
# (C) Tenable Network Security, Inc.
#

include("compat.inc");

if (description)
{
  script_id(125264);
  script_version("1.4");
  script_cvs_date("Date: 2019/10/30 13:24:46");

  script_cve_id(
    "CVE-2019-10127",
    "CVE-2019-10128",
    "CVE-2019-10129",
    "CVE-2019-10130"
  );

  script_name(english:"PostgreSQL 9.4.x < 9.4.22 / 9.5.x < 9.5.17 / 9.6.x < 9.6.13 / 10.x < 10.8 / 11.x < 11.3 Multiple vulnerabilities");
  script_summary(english:"Checks the version of PostgreSQL");

  script_set_attribute(attribute:"synopsis", value:"The remote database server is affected by multiple vulnerabilities.");
  script_set_attribute(attribute:"description", value:
"The version of PostgreSQL installed on the remote host is 9.4.x prior to 9.4.22, 9.5.x prior to 9.5.17, 9.6.x prior to
9.6.13, 10.x prior to 10.8, or 11.x prior to 11.3. It is, therefore, affected by multiple vulnerabilities.

  - A remote code execution vulnerability exists in both, the BigSQL and the EnterpriseDB Windows installers due to the
    installers not locking down the permissions of the PostgreSQL binary installation directory and the data directory.
    An authenticated, local attacker can exploit this, to cause the PostgreSQL service account to execute arbitrary
    code.
    (CVE-2019-10127, CVE-2019-10128)

  - A memory disclosure vulnerability exists in the partition routing component. An authenticated, remote attacker can
    exploit this, via the execution of a crafted INSERT statement to a partitioned table to disclose memory contents.
    (CVE-2019-10129)

  - A security bypass vulnerability exists in the core server. An authenticated, remote attacker can exploit this, via
    the execution of a crafted SQL query with a leaky operator to disclose potentially sensitive information.
    (CVE-2019-10130)
");
  # https://www.postgresql.org/about/news/1939/
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?aeba5e75");
  script_set_attribute(attribute:"solution", value:"Upgrade to PostgreSQL 9.4.22 / 9.5.17 / 9.6.13 / 10.8 / 11.3 or later.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:S/C:P/I:N/A:N");
  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:L/UI:N/S:U/C:L/I:N/A:N");
  script_set_cvss3_temporal_vector("CVSS:3.0/E:U/RL:O/RC:C");
  script_set_attribute(attribute:"cvss_score_source", value:"CVE-2019-10130");
  script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available");


  script_set_attribute(attribute:"vuln_publication_date", value:"2019/05/09");
  script_set_attribute(attribute:"patch_publication_date", value:"2019/05/09");
  script_set_attribute(attribute:"plugin_publication_date", value:"2019/05/17");

  script_set_attribute(attribute:"plugin_type", value:"local");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:postgresql:postgresql");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_family(english:"Databases");

  script_copyright(english:"This script is Copyright (C) 2019 and is owned by Tenable, Inc. or an Affiliate thereof.");

  script_dependencies("postgresql_version.nbin");
  script_require_ports("Services/postgresql", 5432);

  exit(0);
}

include('vcf.inc');
include('backport.inc');

app = 'PostgreSQL';
port = get_service(svc:'postgresql', default:5432, exit_on_fail:TRUE);
kb_base = 'database/' + port + '/postgresql/';
kb_ver = kb_base + 'version';
get_kb_item_or_exit(kb_ver);

kb_backport = NULL;
source = get_kb_item_or_exit(kb_base + 'source');
get_backport_banner(banner:source);
if (backported) kb_backport = kb_base + 'backported';

app_info = vcf::get_app_info(app:app, port:port, kb_ver:kb_ver, kb_backport:kb_backport, service:TRUE);

constraints = [
  { 'min_version' : '9.4.0', 'fixed_version' : '9.4.22' },
  { 'min_version' : '9.5.0', 'fixed_version' : '9.5.17' },
  { 'min_version' : '9.6.0', 'fixed_version' : '9.6.13' },
  { 'min_version' : '10.0', 'fixed_version' : '10.8' },
  { 'min_version' : '11.0', 'fixed_version' : '11.3' }
];

vcf::check_version_and_report(app_info:app_info, constraints:constraints, severity:SECURITY_WARNING);