Vulnerabilities > CVE-2017-7486 - Information Exposure vulnerability in Postgresql

047910
CVSS 5.0 - MEDIUM
Attack vector
NETWORK
Attack complexity
LOW
Privileges required
NONE
Confidentiality impact
PARTIAL
Integrity impact
NONE
Availability impact
NONE
network
low complexity
postgresql
CWE-200
nessus

Summary

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.

Vulnerable Configurations

Part Description Count
Application
Postgresql
134

Common Weakness Enumeration (CWE)

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Subverting Environment Variable Values
    The attacker directly or indirectly modifies environment variables used by or controlling the target software. The attacker's goal is to cause the target software to deviate from its expected operation in a manner that benefits the attacker.
  • Footprinting
    An attacker engages in probing and exploration activity to identify constituents and properties of the target. Footprinting is a general term to describe a variety of information gathering techniques, often used by attackers in preparation for some attack. It consists of using tools to learn as much as possible about the composition, configuration, and security mechanisms of the targeted application, system or network. Information that might be collected during a footprinting effort could include open ports, applications and their versions, network topology, and similar information. While footprinting is not intended to be damaging (although certain activities, such as network scans, can sometimes cause disruptions to vulnerable applications inadvertently) it may often pave the way for more damaging attacks.
  • Exploiting Trust in Client (aka Make the Client Invisible)
    An attack of this type exploits a programs' vulnerabilities in client/server communication channel authentication and data integrity. It leverages the implicit trust a server places in the client, or more importantly, that which the server believes is the client. An attacker executes this type of attack by placing themselves in the communication channel between client and server such that communication directly to the server is possible where the server believes it is communicating only with a valid client. There are numerous variations of this type of attack.
  • Browser Fingerprinting
    An attacker carefully crafts small snippets of Java Script to efficiently detect the type of browser the potential victim is using. Many web-based attacks need prior knowledge of the web browser including the version of browser to ensure successful exploitation of a vulnerability. Having this knowledge allows an attacker to target the victim with attacks that specifically exploit known or zero day weaknesses in the type and version of the browser used by the victim. Automating this process via Java Script as a part of the same delivery system used to exploit the browser is considered more efficient as the attacker can supply a browser fingerprinting method and integrate it with exploit code, all contained in Java Script and in response to the same web page request by the browser.
  • Session Credential Falsification through Prediction
    This attack targets predictable session ID in order to gain privileges. The attacker can predict the session ID used during a transaction to perform spoofing and session hijacking.

Nessus

  • NASL familyAmazon Linux Local Security Checks
    NASL idALA_ALAS-2017-839.NASL
    descriptionSelectivity estimators bypass SELECT privilege checks It was found that some selectivity estimation functions 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) libpq ignores PGREQUIRESSL environment variable It was found that the PGREQUIRESSL was no longer enforcing a SSL/TLS connection to a PostgreSQL server. An active Man-in-the-Middle attacker could use this flaw to strip the SSL/TLS protection from a connection between a client and a server. (CVE-2017-7485) pg_user_mappings view discloses foreign server passwords It was found that the pg_user_mappings view from postgresql could disclose information about user mappings to a foreign database to unprivileged users. An authenticated attacker with USAGE privilege for this mapping could, when querying the view, obtain user mapping data, such as the username and password used to connect to the foreign database. (CVE-2017-7486)
    last seen2020-06-01
    modified2020-06-02
    plugin id100640
    published2017-06-07
    reporterThis script is Copyright (C) 2017-2018 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/100640
    titleAmazon Linux AMI : postgresql93 / postgresql94,postgresql95 (ALAS-2017-839)
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were
    # extracted from Amazon Linux AMI Security Advisory ALAS-2017-839.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(100640);
      script_version("3.5");
      script_cvs_date("Date: 2018/04/18 15:09:36");
    
      script_cve_id("CVE-2017-7484", "CVE-2017-7485", "CVE-2017-7486");
      script_xref(name:"ALAS", value:"2017-839");
    
      script_name(english:"Amazon Linux AMI : postgresql93 / postgresql94,postgresql95 (ALAS-2017-839)");
      script_summary(english:"Checks rpm output for the updated packages");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote Amazon Linux AMI host is missing a security update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "Selectivity estimators bypass SELECT privilege checks
    
    It was found that some selectivity estimation functions 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)
    
    libpq ignores PGREQUIRESSL environment variable
    
    It was found that the PGREQUIRESSL was no longer enforcing a SSL/TLS
    connection to a PostgreSQL server. An active Man-in-the-Middle
    attacker could use this flaw to strip the SSL/TLS protection from a
    connection between a client and a server. (CVE-2017-7485)
    
    pg_user_mappings view discloses foreign server passwords
    
    It was found that the pg_user_mappings view from postgresql could
    disclose information about user mappings to a foreign database to
    unprivileged users. An authenticated attacker with USAGE privilege for
    this mapping could, when querying the view, obtain user mapping data,
    such as the username and password used to connect to the foreign
    database. (CVE-2017-7486)"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://alas.aws.amazon.com/ALAS-2017-839.html"
      );
      script_set_attribute(
        attribute:"solution", 
        value:
    "Run 'yum update postgresql93' to update your system.
    
    Run 'yum update postgresql94' to update your system.
    
    Run 'yum update postgresql95' to update your system."
      );
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:N/A:N");
      script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql93");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql93-contrib");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql93-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql93-devel");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql93-docs");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql93-libs");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql93-plperl");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql93-plpython26");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql93-plpython27");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql93-pltcl");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql93-server");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql93-test");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql94");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql94-contrib");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql94-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql94-devel");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql94-docs");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql94-libs");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql94-plperl");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql94-plpython26");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql94-plpython27");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql94-server");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql94-test");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql95");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql95-contrib");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql95-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql95-devel");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql95-docs");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql95-libs");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql95-plperl");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql95-plpython26");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql95-plpython27");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql95-server");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql95-static");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql95-test");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:amazon:linux");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2017/06/06");
      script_set_attribute(attribute:"plugin_publication_date", value:"2017/06/07");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2017-2018 Tenable Network Security, Inc.");
      script_family(english:"Amazon Linux Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/AmazonLinux/release", "Host/AmazonLinux/rpm-list");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("global_settings.inc");
    include("rpm.inc");
    
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    
    release = get_kb_item("Host/AmazonLinux/release");
    if (isnull(release) || !strlen(release)) audit(AUDIT_OS_NOT, "Amazon Linux");
    os_ver = pregmatch(pattern: "^AL(A|\d)", string:release);
    if (isnull(os_ver)) audit(AUDIT_UNKNOWN_APP_VER, "Amazon Linux");
    os_ver = os_ver[1];
    if (os_ver != "A")
    {
      if (os_ver == 'A') os_ver = 'AMI';
      audit(AUDIT_OS_NOT, "Amazon Linux AMI", "Amazon Linux " + os_ver);
    }
    
    if (!get_kb_item("Host/AmazonLinux/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    
    flag = 0;
    if (rpm_check(release:"ALA", reference:"postgresql93-9.3.17-1.63.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql93-contrib-9.3.17-1.63.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql93-debuginfo-9.3.17-1.63.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql93-devel-9.3.17-1.63.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql93-docs-9.3.17-1.63.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql93-libs-9.3.17-1.63.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql93-plperl-9.3.17-1.63.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql93-plpython26-9.3.17-1.63.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql93-plpython27-9.3.17-1.63.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql93-pltcl-9.3.17-1.63.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql93-server-9.3.17-1.63.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql93-test-9.3.17-1.63.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql94-9.4.12-1.68.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql94-contrib-9.4.12-1.68.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql94-debuginfo-9.4.12-1.68.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql94-devel-9.4.12-1.68.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql94-docs-9.4.12-1.68.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql94-libs-9.4.12-1.68.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql94-plperl-9.4.12-1.68.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql94-plpython26-9.4.12-1.68.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql94-plpython27-9.4.12-1.68.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql94-server-9.4.12-1.68.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql94-test-9.4.12-1.68.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql95-9.5.7-1.72.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql95-contrib-9.5.7-1.72.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql95-debuginfo-9.5.7-1.72.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql95-devel-9.5.7-1.72.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql95-docs-9.5.7-1.72.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql95-libs-9.5.7-1.72.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql95-plperl-9.5.7-1.72.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql95-plpython26-9.5.7-1.72.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql95-plpython27-9.5.7-1.72.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql95-server-9.5.7-1.72.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql95-static-9.5.7-1.72.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql95-test-9.5.7-1.72.amzn1")) flag++;
    
    if (flag)
    {
      if (report_verbosity > 0) security_warning(port:0, extra:rpm_report_get());
      else security_warning(0);
      exit(0);
    }
    else
    {
      tested = pkg_tests_get();
      if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
      else audit(AUDIT_PACKAGE_NOT_INSTALLED, "postgresql93 / postgresql93-contrib / postgresql93-debuginfo / etc");
    }
    
  • NASL familySuSE Local Security Checks
    NASL idOPENSUSE-2017-657.NASL
    descriptionThis update for postgresql93 fixes the following issues : The PostgreSQL package was updated to 9.3.17, bringing various bug and security fixes. Security fixes : - CVE-2017-7486: Restrict visibility of pg_user_mappings.umoptions, to protect passwords stored as user mapping options. (bsc#1037624) - CVE-2017-7485: Recognize PGREQUIRESSL variable again. (bsc#1038293) - CVE-2017-7484: Prevent exposure of statistical information via leaky operators. (bsc#1037603) More details can be found in the PostgreSQL release announcements : - https://www.postgresql.org/docs/9.3/static/release-9-3-17.html - https://www.postgresql.org/docs/9.3/static/release-9-3-16.html - https://www.postgresql.org/docs/9.3/static/release-9-3-15.html This update was imported from the SUSE:SLE-12:Update update project.
    last seen2020-06-05
    modified2017-06-07
    plugin id100659
    published2017-06-07
    reporterThis script is Copyright (C) 2017-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/100659
    titleopenSUSE Security Update : postgresql93 (openSUSE-2017-657)
    code
    #%NASL_MIN_LEVEL 80502
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were
    # extracted from openSUSE Security Update openSUSE-2017-657.
    #
    # The text description of this plugin is (C) SUSE LLC.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(100659);
      script_version("3.6");
      script_set_attribute(attribute:"plugin_modification_date", value:"2020/06/04");
    
      script_cve_id("CVE-2017-7484", "CVE-2017-7485", "CVE-2017-7486");
    
      script_name(english:"openSUSE Security Update : postgresql93 (openSUSE-2017-657)");
      script_summary(english:"Check for the openSUSE-2017-657 patch");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote openSUSE host is missing a security update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "This update for postgresql93 fixes the following issues :
    
    The PostgreSQL package was updated to 9.3.17, bringing various bug and
    security fixes.
    
    Security fixes :
    
      - CVE-2017-7486: Restrict visibility of
        pg_user_mappings.umoptions, to protect passwords stored
        as user mapping options. (bsc#1037624) 
    
      - CVE-2017-7485: Recognize PGREQUIRESSL variable again.
        (bsc#1038293)
    
      - CVE-2017-7484: Prevent exposure of statistical
        information via leaky operators. (bsc#1037603)
    
    More details can be found in the PostgreSQL release announcements :
    
    - https://www.postgresql.org/docs/9.3/static/release-9-3-17.html
    
    - https://www.postgresql.org/docs/9.3/static/release-9-3-16.html
    
    - https://www.postgresql.org/docs/9.3/static/release-9-3-15.html
    
    This update was imported from the SUSE:SLE-12:Update update project."
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.opensuse.org/show_bug.cgi?id=1037603"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.opensuse.org/show_bug.cgi?id=1037624"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.opensuse.org/show_bug.cgi?id=1038293"
      );
      # https://www.postgresql.org/docs/9.3/static/release-9-3-15.html
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.postgresql.org/docs/9.3/release-9-3-15.html"
      );
      # https://www.postgresql.org/docs/9.3/static/release-9-3-16.html
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.postgresql.org/docs/9.3/release-9-3-16.html"
      );
      # https://www.postgresql.org/docs/9.3/static/release-9-3-17.html
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.postgresql.org/docs/9.3/release-9-3-17.html"
      );
      script_set_attribute(
        attribute:"solution", 
        value:"Update the affected postgresql93 packages."
      );
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:N/A:N");
      script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql93");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql93-contrib");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql93-contrib-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql93-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql93-debugsource");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql93-devel");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql93-devel-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql93-libs-debugsource");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql93-plperl");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql93-plperl-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql93-plpython");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql93-plpython-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql93-pltcl");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql93-pltcl-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql93-server");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql93-server-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql93-test");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:novell:opensuse:42.2");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2017/06/06");
      script_set_attribute(attribute:"plugin_publication_date", value:"2017/06/07");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2017-2020 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"SuSE Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/SuSE/release", "Host/SuSE/rpm-list", "Host/cpu");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("global_settings.inc");
    include("rpm.inc");
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    release = get_kb_item("Host/SuSE/release");
    if (isnull(release) || release =~ "^(SLED|SLES)") audit(AUDIT_OS_NOT, "openSUSE");
    if (release !~ "^(SUSE42\.2)$") audit(AUDIT_OS_RELEASE_NOT, "openSUSE", "42.2", release);
    if (!get_kb_item("Host/SuSE/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    ourarch = get_kb_item("Host/cpu");
    if (!ourarch) audit(AUDIT_UNKNOWN_ARCH);
    if (ourarch !~ "^(i586|i686|x86_64)$") audit(AUDIT_ARCH_NOT, "i586 / i686 / x86_64", ourarch);
    
    flag = 0;
    
    if ( rpm_check(release:"SUSE42.2", reference:"postgresql93-devel-9.3.17-5.9.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"postgresql93-devel-debuginfo-9.3.17-5.9.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"postgresql93-libs-debugsource-9.3.17-5.9.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", cpu:"x86_64", reference:"postgresql93-9.3.17-5.9.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", cpu:"x86_64", reference:"postgresql93-contrib-9.3.17-5.9.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", cpu:"x86_64", reference:"postgresql93-contrib-debuginfo-9.3.17-5.9.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", cpu:"x86_64", reference:"postgresql93-debuginfo-9.3.17-5.9.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", cpu:"x86_64", reference:"postgresql93-debugsource-9.3.17-5.9.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", cpu:"x86_64", reference:"postgresql93-plperl-9.3.17-5.9.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", cpu:"x86_64", reference:"postgresql93-plperl-debuginfo-9.3.17-5.9.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", cpu:"x86_64", reference:"postgresql93-plpython-9.3.17-5.9.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", cpu:"x86_64", reference:"postgresql93-plpython-debuginfo-9.3.17-5.9.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", cpu:"x86_64", reference:"postgresql93-pltcl-9.3.17-5.9.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", cpu:"x86_64", reference:"postgresql93-pltcl-debuginfo-9.3.17-5.9.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", cpu:"x86_64", reference:"postgresql93-server-9.3.17-5.9.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", cpu:"x86_64", reference:"postgresql93-server-debuginfo-9.3.17-5.9.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", cpu:"x86_64", reference:"postgresql93-test-9.3.17-5.9.1") ) flag++;
    
    if (flag)
    {
      if (report_verbosity > 0) security_warning(port:0, extra:rpm_report_get());
      else security_warning(0);
      exit(0);
    }
    else
    {
      tested = pkg_tests_get();
      if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
      else audit(AUDIT_PACKAGE_NOT_INSTALLED, "postgresql93-devel / postgresql93-devel-debuginfo / etc");
    }
    
  • NASL familyDebian Local Security Checks
    NASL idDEBIAN_DLA-1051.NASL
    descriptionSeveral vulnerabilities have been found in the PostgreSQL database system : CVE-2017-7486 Andrew Wheelwright discovered that user mappings were insufficiently restricted. CVE-2017-7546 In some authentication methods empty passwords were accepted. CVE-2017-7547 User mappings could leak data to unprivileged users. For Debian 7
    last seen2020-03-17
    modified2017-08-11
    plugin id102368
    published2017-08-11
    reporterThis script is Copyright (C) 2017-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/102368
    titleDebian DLA-1051-1 : postgresql-9.1 security update
    code
    #%NASL_MIN_LEVEL 80502
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were
    # extracted from Debian Security Advisory DLA-1051-1. The text
    # itself is copyright (C) Software in the Public Interest, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(102368);
      script_version("3.11");
      script_set_attribute(attribute:"plugin_modification_date", value:"2020/03/12");
    
      script_cve_id("CVE-2017-7486", "CVE-2017-7546", "CVE-2017-7547");
    
      script_name(english:"Debian DLA-1051-1 : postgresql-9.1 security update");
      script_summary(english:"Checks dpkg output for the updated packages.");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote Debian host is missing a security update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "Several vulnerabilities have been found in the PostgreSQL database
    system :
    
    CVE-2017-7486
    
    Andrew Wheelwright discovered that user mappings were insufficiently
    restricted.
    
    CVE-2017-7546
    
    In some authentication methods empty passwords were accepted.
    
    CVE-2017-7547
    
    User mappings could leak data to unprivileged users.
    
    For Debian 7 'Wheezy', these problems have been fixed in version
    9.1.24lts2-0+deb7u1.
    
    We recommend that you upgrade your postgresql-9.1 packages.
    
    NOTE: Tenable Network Security has extracted the preceding description
    block directly from the DLA security advisory. Tenable has attempted
    to automatically clean and format it as much as possible without
    introducing additional issues."
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://lists.debian.org/debian-lts-announce/2017/08/msg00003.html"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://packages.debian.org/source/wheezy/postgresql-9.1"
      );
      script_set_attribute(attribute:"solution", value:"Upgrade the affected packages.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:P/A:P");
      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:"exploitability_ease", value:"No known exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"false");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libecpg-compat3");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libecpg-dev");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libecpg6");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libpgtypes3");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libpq-dev");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libpq5");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:postgresql-9.1");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:postgresql-9.1-dbg");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:postgresql-client-9.1");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:postgresql-contrib-9.1");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:postgresql-doc-9.1");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:postgresql-plperl-9.1");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:postgresql-plpython-9.1");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:postgresql-plpython3-9.1");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:postgresql-pltcl-9.1");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:postgresql-server-dev-9.1");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:debian:debian_linux:7.0");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2017/08/10");
      script_set_attribute(attribute:"plugin_publication_date", value:"2017/08/11");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2017-2020 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"Debian Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/Debian/release", "Host/Debian/dpkg-l");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("debian_package.inc");
    
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    if (!get_kb_item("Host/Debian/release")) audit(AUDIT_OS_NOT, "Debian");
    if (!get_kb_item("Host/Debian/dpkg-l")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    
    flag = 0;
    if (deb_check(release:"7.0", prefix:"libecpg-compat3", reference:"9.1.24-0+deb7u1")) flag++;
    if (deb_check(release:"7.0", prefix:"libecpg-dev", reference:"9.1.24-0+deb7u1")) flag++;
    if (deb_check(release:"7.0", prefix:"libecpg6", reference:"9.1.24-0+deb7u1")) flag++;
    if (deb_check(release:"7.0", prefix:"libpgtypes3", reference:"9.1.24-0+deb7u1")) flag++;
    if (deb_check(release:"7.0", prefix:"libpq-dev", reference:"9.1.24-0+deb7u1")) flag++;
    if (deb_check(release:"7.0", prefix:"libpq5", reference:"9.1.24-0+deb7u1")) flag++;
    if (deb_check(release:"7.0", prefix:"postgresql-9.1", reference:"9.1.24-0+deb7u1")) flag++;
    if (deb_check(release:"7.0", prefix:"postgresql-9.1-dbg", reference:"9.1.24-0+deb7u1")) flag++;
    if (deb_check(release:"7.0", prefix:"postgresql-client-9.1", reference:"9.1.24-0+deb7u1")) flag++;
    if (deb_check(release:"7.0", prefix:"postgresql-contrib-9.1", reference:"9.1.24-0+deb7u1")) flag++;
    if (deb_check(release:"7.0", prefix:"postgresql-doc-9.1", reference:"9.1.24-0+deb7u1")) flag++;
    if (deb_check(release:"7.0", prefix:"postgresql-plperl-9.1", reference:"9.1.24-0+deb7u1")) flag++;
    if (deb_check(release:"7.0", prefix:"postgresql-plpython-9.1", reference:"9.1.24-0+deb7u1")) flag++;
    if (deb_check(release:"7.0", prefix:"postgresql-plpython3-9.1", reference:"9.1.24-0+deb7u1")) flag++;
    if (deb_check(release:"7.0", prefix:"postgresql-pltcl-9.1", reference:"9.1.24-0+deb7u1")) flag++;
    if (deb_check(release:"7.0", prefix:"postgresql-server-dev-9.1", reference:"9.1.24-0+deb7u1")) flag++;
    
    if (flag)
    {
      if (report_verbosity > 0) security_hole(port:0, extra:deb_report_get());
      else security_hole(0);
      exit(0);
    }
    else audit(AUDIT_HOST_NOT, "affected");
    
  • NASL familySuSE Local Security Checks
    NASL idSUSE_SU-2017-1690-1.NASL
    descriptionThis update for postgresql94 to 9.4.12 fixes the following issues: Upstream changelogs : - https://www.postgresql.org/docs/9.4/static/release-9-4-12.html - https://www.postgresql.org/docs/9.4/static/release-9-4-11.html - https://www.postgresql.org/docs/9.4/static/release-9-4-10.html Security issues fixed : - CVE-2017-7486: Restrict visibility of pg_user_mappings.umoptions, to protect passwords stored as user mapping options. (bsc#1037624) Please note that manual action is needed to fix this in existing databases See the upstream release notes for details. - CVE-2017-7485: recognize PGREQUIRESSL variable again. (bsc#1038293) - CVE-2017-7484: Prevent exposure of statistical information via leaky operators. (bsc#1037603) Changes in version 9.4.12 : - Build corruption with CREATE INDEX CONCURRENTLY - Fixes for visibility and write-ahead-log stability Changes in version 9.4.10 : - Fix WAL-logging of truncation of relation free space maps and visibility maps - Fix incorrect creation of GIN index WAL records on big-endian machines - Fix SELECT FOR UPDATE/SHARE to correctly lock tuples that have been updated by a subsequently-aborted transaction - Fix EvalPlanQual rechecks involving CTE scans - Fix improper repetition of previous results from hashed aggregation in a subquery The libraries libpq and libecpg are now supplied by postgresql 9.6. Note that Tenable Network Security has extracted the preceding description block directly from the SUSE security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen2020-06-01
    modified2020-06-02
    plugin id101060
    published2017-06-27
    reporterThis script is Copyright (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/101060
    titleSUSE SLED12 / SLES12 Security Update : postgresql94 (SUSE-SU-2017:1690-1)
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were
    # extracted from SUSE update advisory SUSE-SU-2017:1690-1.
    # The text itself is copyright (C) SUSE.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(101060);
      script_version("3.11");
      script_cvs_date("Date: 2019/09/11 11:22:15");
    
      script_cve_id("CVE-2017-7484", "CVE-2017-7485", "CVE-2017-7486");
    
      script_name(english:"SUSE SLED12 / SLES12 Security Update : postgresql94 (SUSE-SU-2017:1690-1)");
      script_summary(english:"Checks rpm output for the updated packages.");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote SUSE host is missing one or more security updates."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "This update for postgresql94 to 9.4.12 fixes the following issues:
    Upstream changelogs :
    
    - https://www.postgresql.org/docs/9.4/static/release-9-4-12.html
    
    - https://www.postgresql.org/docs/9.4/static/release-9-4-11.html
    
    - https://www.postgresql.org/docs/9.4/static/release-9-4-10.html
    Security issues fixed :
    
      - CVE-2017-7486: Restrict visibility of
        pg_user_mappings.umoptions, to protect passwords stored
        as user mapping options. (bsc#1037624) Please note that
        manual action is needed to fix this in existing
        databases See the upstream release notes for details.
    
      - CVE-2017-7485: recognize PGREQUIRESSL variable again.
        (bsc#1038293)
    
      - CVE-2017-7484: Prevent exposure of statistical
        information via leaky operators. (bsc#1037603) Changes
        in version 9.4.12 :
    
      - Build corruption with CREATE INDEX CONCURRENTLY
    
      - Fixes for visibility and write-ahead-log stability
        Changes in version 9.4.10 :
    
      - Fix WAL-logging of truncation of relation free space
        maps and visibility maps
    
      - Fix incorrect creation of GIN index WAL records on
        big-endian machines
    
      - Fix SELECT FOR UPDATE/SHARE to correctly lock tuples
        that have been updated by a subsequently-aborted
        transaction
    
      - Fix EvalPlanQual rechecks involving CTE scans
    
      - Fix improper repetition of previous results from hashed
        aggregation in a subquery The libraries libpq and
        libecpg are now supplied by postgresql 9.6.
    
    Note that Tenable Network Security has extracted the preceding
    description block directly from the SUSE security advisory. Tenable
    has attempted to automatically clean and format it as much as possible
    without introducing additional issues."
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.suse.com/show_bug.cgi?id=1037603"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.suse.com/show_bug.cgi?id=1037624"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.suse.com/show_bug.cgi?id=1038293"
      );
      # https://www.postgresql.org/docs/9.4/static/release-9-4-10.html
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.postgresql.org/docs/9.4/release-9-4-10.html"
      );
      # https://www.postgresql.org/docs/9.4/static/release-9-4-11.html
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.postgresql.org/docs/9.4/release-9-4-11.html"
      );
      # https://www.postgresql.org/docs/9.4/static/release-9-4-12.html
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.postgresql.org/docs/9.4/release-9-4-12.html"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.suse.com/security/cve/CVE-2017-7484/"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.suse.com/security/cve/CVE-2017-7485/"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.suse.com/security/cve/CVE-2017-7486/"
      );
      # https://www.suse.com/support/update/announcement/2017/suse-su-20171690-1/
      script_set_attribute(
        attribute:"see_also",
        value:"http://www.nessus.org/u?c0c7f331"
      );
      script_set_attribute(
        attribute:"solution", 
        value:
    "To install this SUSE Security Update use YaST online_update.
    Alternatively you can run the command listed for your product :
    
    SUSE Linux Enterprise Software Development Kit 12-SP2:zypper in -t
    patch SUSE-SLE-SDK-12-SP2-2017-1039=1
    
    SUSE Linux Enterprise Server for Raspberry Pi 12-SP2:zypper in -t
    patch SUSE-SLE-RPI-12-SP2-2017-1039=1
    
    SUSE Linux Enterprise Server 12-SP2:zypper in -t patch
    SUSE-SLE-SERVER-12-SP2-2017-1039=1
    
    SUSE Linux Enterprise Desktop 12-SP2:zypper in -t patch
    SUSE-SLE-DESKTOP-12-SP2-2017-1039=1
    
    To bring your system up-to-date, use 'zypper patch'."
      );
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/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:N/UI:N/S:U/C:H/I:N/A:N");
      script_set_cvss3_temporal_vector("CVSS:3.0/E:U/RL:O/RC:C");
      script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"false");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:suse_linux:postgresql94");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:suse_linux:postgresql94-contrib");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:suse_linux:postgresql94-contrib-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:suse_linux:postgresql94-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:suse_linux:postgresql94-debugsource");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:suse_linux:postgresql94-server");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:suse_linux:postgresql94-server-debuginfo");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:novell:suse_linux:12");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2017/05/12");
      script_set_attribute(attribute:"patch_publication_date", value:"2017/06/26");
      script_set_attribute(attribute:"plugin_publication_date", value:"2017/06/27");
      script_set_attribute(attribute:"generated_plugin", value:"current");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"SuSE Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/cpu", "Host/SuSE/release", "Host/SuSE/rpm-list");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("global_settings.inc");
    include("rpm.inc");
    
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    release = get_kb_item("Host/SuSE/release");
    if (isnull(release) || release !~ "^(SLED|SLES)") audit(AUDIT_OS_NOT, "SUSE");
    os_ver = pregmatch(pattern: "^(SLE(S|D)\d+)", string:release);
    if (isnull(os_ver)) audit(AUDIT_UNKNOWN_APP_VER, "SUSE");
    os_ver = os_ver[1];
    if (! preg(pattern:"^(SLED12|SLES12)$", string:os_ver)) audit(AUDIT_OS_NOT, "SUSE SLED12 / SLES12", "SUSE " + os_ver);
    
    if (!get_kb_item("Host/SuSE/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    cpu = get_kb_item("Host/cpu");
    if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);
    if (cpu !~ "^i[3-6]86$" && "x86_64" >!< cpu && "s390x" >!< cpu) audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "SUSE " + os_ver, cpu);
    if (cpu >!< "x86_64") audit(AUDIT_ARCH_NOT, "x86_64", cpu);
    
    
    sp = get_kb_item("Host/SuSE/patchlevel");
    if (isnull(sp)) sp = "0";
    if (os_ver == "SLES12" && (! preg(pattern:"^(2)$", string:sp))) audit(AUDIT_OS_NOT, "SLES12 SP2", os_ver + " SP" + sp);
    if (os_ver == "SLED12" && (! preg(pattern:"^(2)$", string:sp))) audit(AUDIT_OS_NOT, "SLED12 SP2", os_ver + " SP" + sp);
    
    
    flag = 0;
    if (rpm_check(release:"SLES12", sp:"2", cpu:"x86_64", reference:"postgresql94-9.4.12-20.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"2", cpu:"x86_64", reference:"postgresql94-contrib-9.4.12-20.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"2", cpu:"x86_64", reference:"postgresql94-contrib-debuginfo-9.4.12-20.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"2", cpu:"x86_64", reference:"postgresql94-debuginfo-9.4.12-20.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"2", cpu:"x86_64", reference:"postgresql94-debugsource-9.4.12-20.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"2", cpu:"x86_64", reference:"postgresql94-server-9.4.12-20.1")) flag++;
    if (rpm_check(release:"SLES12", sp:"2", cpu:"x86_64", reference:"postgresql94-server-debuginfo-9.4.12-20.1")) flag++;
    if (rpm_check(release:"SLED12", sp:"2", cpu:"x86_64", reference:"postgresql94-9.4.12-20.1")) flag++;
    if (rpm_check(release:"SLED12", sp:"2", cpu:"x86_64", reference:"postgresql94-debuginfo-9.4.12-20.1")) flag++;
    if (rpm_check(release:"SLED12", sp:"2", cpu:"x86_64", reference:"postgresql94-debugsource-9.4.12-20.1")) flag++;
    
    
    if (flag)
    {
      if (report_verbosity > 0) security_warning(port:0, extra:rpm_report_get());
      else security_warning(0);
      exit(0);
    }
    else
    {
      tested = pkg_tests_get();
      if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
      else audit(AUDIT_PACKAGE_NOT_INSTALLED, "postgresql94");
    }
    
  • NASL familySuSE Local Security Checks
    NASL idSUSE_SU-2017-1441-1.NASL
    descriptionThis update for postgresql93 fixes the following issues: The PostgreSQL package was updated to 9.3.17, bringing various bug and security fixes. Bug fixes : - bsc#1029547: Fix tests with timezone 2017a - CVE-2017-7486: Restrict visibility of pg_user_mappings.umoptions, to protect passwords stored as user mapping options. (bsc#1037624) - CVE-2017-7485: Recognize PGREQUIRESSL variable again. (bsc#1038293) - CVE-2017-7484: Prevent exposure of statistical information via leaky operators. (bsc#1037603) More details can be found in the PostgreSQL release announcements : - https://www.postgresql.org/docs/9.3/static/release-9-3-17.html - https://www.postgresql.org/docs/9.3/static/release-9-3-16.html - https://www.postgresql.org/docs/9.3/static/release-9-3-15.html Note that Tenable Network Security has extracted the preceding description block directly from the SUSE security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen2020-06-01
    modified2020-06-02
    plugin id100538
    published2017-05-31
    reporterThis script is Copyright (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/100538
    titleSUSE SLES12 Security Update : postgresql93 (SUSE-SU-2017:1441-1)
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were
    # extracted from SUSE update advisory SUSE-SU-2017:1441-1.
    # The text itself is copyright (C) SUSE.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(100538);
      script_version("3.11");
      script_cvs_date("Date: 2019/09/11 11:22:15");
    
      script_cve_id("CVE-2017-7484", "CVE-2017-7485", "CVE-2017-7486");
    
      script_name(english:"SUSE SLES12 Security Update : postgresql93 (SUSE-SU-2017:1441-1)");
      script_summary(english:"Checks rpm output for the updated packages.");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote SUSE host is missing one or more security updates."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "This update for postgresql93 fixes the following issues: The
    PostgreSQL package was updated to 9.3.17, bringing various bug and
    security fixes. Bug fixes :
    
      - bsc#1029547: Fix tests with timezone 2017a
    
      - CVE-2017-7486: Restrict visibility of
        pg_user_mappings.umoptions, to protect passwords stored
        as user mapping options. (bsc#1037624)
    
      - CVE-2017-7485: Recognize PGREQUIRESSL variable again.
        (bsc#1038293)
    
      - CVE-2017-7484: Prevent exposure of statistical
        information via leaky operators. (bsc#1037603) More
        details can be found in the PostgreSQL release
        announcements :
    
    - https://www.postgresql.org/docs/9.3/static/release-9-3-17.html
    
    - https://www.postgresql.org/docs/9.3/static/release-9-3-16.html
    
    - https://www.postgresql.org/docs/9.3/static/release-9-3-15.html
    
    Note that Tenable Network Security has extracted the preceding
    description block directly from the SUSE security advisory. Tenable
    has attempted to automatically clean and format it as much as possible
    without introducing additional issues."
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.suse.com/show_bug.cgi?id=1029547"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.suse.com/show_bug.cgi?id=1037603"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.suse.com/show_bug.cgi?id=1037624"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.suse.com/show_bug.cgi?id=1038293"
      );
      # https://www.postgresql.org/docs/9.3/static/release-9-3-15.html
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.postgresql.org/docs/9.3/release-9-3-15.html"
      );
      # https://www.postgresql.org/docs/9.3/static/release-9-3-16.html
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.postgresql.org/docs/9.3/release-9-3-16.html"
      );
      # https://www.postgresql.org/docs/9.3/static/release-9-3-17.html
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.postgresql.org/docs/9.3/release-9-3-17.html"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.suse.com/security/cve/CVE-2017-7484/"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.suse.com/security/cve/CVE-2017-7485/"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.suse.com/security/cve/CVE-2017-7486/"
      );
      # https://www.suse.com/support/update/announcement/2017/suse-su-20171441-1/
      script_set_attribute(
        attribute:"see_also",
        value:"http://www.nessus.org/u?b83f04d9"
      );
      script_set_attribute(
        attribute:"solution", 
        value:
    "To install this SUSE Security Update use YaST online_update.
    Alternatively you can run the command listed for your product :
    
    SUSE Linux Enterprise Server for SAP 12:zypper in -t patch
    SUSE-SLE-SAP-12-2017-881=1
    
    SUSE Linux Enterprise Server 12-LTSS:zypper in -t patch
    SUSE-SLE-SERVER-12-2017-881=1
    
    To bring your system up-to-date, use 'zypper patch'."
      );
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/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:N/UI:N/S:U/C:H/I:N/A:N");
      script_set_cvss3_temporal_vector("CVSS:3.0/E:U/RL:O/RC:C");
      script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"false");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:suse_linux:postgresql93");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:suse_linux:postgresql93-contrib");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:suse_linux:postgresql93-contrib-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:suse_linux:postgresql93-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:suse_linux:postgresql93-debugsource");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:suse_linux:postgresql93-server");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:suse_linux:postgresql93-server-debuginfo");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:novell:suse_linux:12");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2017/05/12");
      script_set_attribute(attribute:"patch_publication_date", value:"2017/05/30");
      script_set_attribute(attribute:"plugin_publication_date", value:"2017/05/31");
      script_set_attribute(attribute:"generated_plugin", value:"current");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"SuSE Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/cpu", "Host/SuSE/release", "Host/SuSE/rpm-list");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("global_settings.inc");
    include("rpm.inc");
    
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    release = get_kb_item("Host/SuSE/release");
    if (isnull(release) || release !~ "^(SLED|SLES)") audit(AUDIT_OS_NOT, "SUSE");
    os_ver = pregmatch(pattern: "^(SLE(S|D)\d+)", string:release);
    if (isnull(os_ver)) audit(AUDIT_UNKNOWN_APP_VER, "SUSE");
    os_ver = os_ver[1];
    if (! preg(pattern:"^(SLES12)$", string:os_ver)) audit(AUDIT_OS_NOT, "SUSE SLES12", "SUSE " + os_ver);
    
    if (!get_kb_item("Host/SuSE/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    cpu = get_kb_item("Host/cpu");
    if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);
    if (cpu !~ "^i[3-6]86$" && "x86_64" >!< cpu && "s390x" >!< cpu) audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "SUSE " + os_ver, cpu);
    
    sp = get_kb_item("Host/SuSE/patchlevel");
    if (isnull(sp)) sp = "0";
    if (os_ver == "SLES12" && (! preg(pattern:"^(0)$", string:sp))) audit(AUDIT_OS_NOT, "SLES12 SP0", os_ver + " SP" + sp);
    
    
    flag = 0;
    if (rpm_check(release:"SLES12", sp:"0", reference:"postgresql93-9.3.17-24.2")) flag++;
    if (rpm_check(release:"SLES12", sp:"0", reference:"postgresql93-contrib-9.3.17-24.2")) flag++;
    if (rpm_check(release:"SLES12", sp:"0", reference:"postgresql93-contrib-debuginfo-9.3.17-24.2")) flag++;
    if (rpm_check(release:"SLES12", sp:"0", reference:"postgresql93-debuginfo-9.3.17-24.2")) flag++;
    if (rpm_check(release:"SLES12", sp:"0", reference:"postgresql93-debugsource-9.3.17-24.2")) flag++;
    if (rpm_check(release:"SLES12", sp:"0", reference:"postgresql93-server-9.3.17-24.2")) flag++;
    if (rpm_check(release:"SLES12", sp:"0", reference:"postgresql93-server-debuginfo-9.3.17-24.2")) flag++;
    
    
    if (flag)
    {
      if (report_verbosity > 0) security_warning(port:0, extra:rpm_report_get());
      else security_warning(0);
      exit(0);
    }
    else
    {
      tested = pkg_tests_get();
      if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
      else audit(AUDIT_PACKAGE_NOT_INSTALLED, "postgresql93");
    }
    
  • NASL familySuSE Local Security Checks
    NASL idOPENSUSE-2017-770.NASL
    descriptionThis update for postgresql94 to 9.4.12 fixes the following issues : Upstream changelogs : - https://www.postgresql.org/docs/9.4/static/release-9-4-12.html - https://www.postgresql.org/docs/9.4/static/release-9-4-11.html - https://www.postgresql.org/docs/9.4/static/release-9-4-10.html Security issues fixed : - CVE-2017-7486: Restrict visibility of pg_user_mappings.umoptions, to protect passwords stored as user mapping options. (bsc#1037624) Please note that manual action is needed to fix this in existing databases See the upstream release notes for details. - CVE-2017-7485: recognize PGREQUIRESSL variable again. (bsc#1038293) - CVE-2017-7484: Prevent exposure of statistical information via leaky operators. (bsc#1037603) Changes in version 9.4.12 : - Build corruption with CREATE INDEX CONCURRENTLY - Fixes for visibility and write-ahead-log stability Changes in version 9.4.10 : - Fix WAL-logging of truncation of relation free space maps and visibility maps - Fix incorrect creation of GIN index WAL records on big-endian machines - Fix SELECT FOR UPDATE/SHARE to correctly lock tuples that have been updated by a subsequently-aborted transaction - Fix EvalPlanQual rechecks involving CTE scans - Fix improper repetition of previous results from hashed aggregation in a subquery The libraries libpq and libecpg are now supplied by postgresql 9.6. This update was imported from the SUSE:SLE-12:Update update project.
    last seen2020-06-05
    modified2017-07-05
    plugin id101220
    published2017-07-05
    reporterThis script is Copyright (C) 2017-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/101220
    titleopenSUSE Security Update : postgresql94 (openSUSE-2017-770)
    code
    #%NASL_MIN_LEVEL 80502
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were
    # extracted from openSUSE Security Update openSUSE-2017-770.
    #
    # The text description of this plugin is (C) SUSE LLC.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(101220);
      script_version("3.6");
      script_set_attribute(attribute:"plugin_modification_date", value:"2020/06/04");
    
      script_cve_id("CVE-2017-7484", "CVE-2017-7485", "CVE-2017-7486");
    
      script_name(english:"openSUSE Security Update : postgresql94 (openSUSE-2017-770)");
      script_summary(english:"Check for the openSUSE-2017-770 patch");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote openSUSE host is missing a security update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "This update for postgresql94 to 9.4.12 fixes the following issues :
    
    Upstream changelogs :
    
    - https://www.postgresql.org/docs/9.4/static/release-9-4-12.html
    
    - https://www.postgresql.org/docs/9.4/static/release-9-4-11.html
    
    - https://www.postgresql.org/docs/9.4/static/release-9-4-10.html
    
    Security issues fixed :
    
      - CVE-2017-7486: Restrict visibility of
        pg_user_mappings.umoptions, to protect passwords stored
        as user mapping options. (bsc#1037624)
    
        Please note that manual action is needed to fix this in
        existing databases See the upstream release notes for
        details.
    
      - CVE-2017-7485: recognize PGREQUIRESSL variable again.
        (bsc#1038293)
    
      - CVE-2017-7484: Prevent exposure of statistical
        information via leaky operators. (bsc#1037603)
    
    Changes in version 9.4.12 :
    
      - Build corruption with CREATE INDEX CONCURRENTLY
    
      - Fixes for visibility and write-ahead-log stability
    
    Changes in version 9.4.10 :
    
      - Fix WAL-logging of truncation of relation free space
        maps and visibility maps
    
      - Fix incorrect creation of GIN index WAL records on
        big-endian machines
    
      - Fix SELECT FOR UPDATE/SHARE to correctly lock tuples
        that have been updated by a subsequently-aborted
        transaction
    
      - Fix EvalPlanQual rechecks involving CTE scans
    
      - Fix improper repetition of previous results from hashed
        aggregation in a subquery
    
    The libraries libpq and libecpg are now supplied by postgresql 9.6.
    
    This update was imported from the SUSE:SLE-12:Update update project."
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.opensuse.org/show_bug.cgi?id=1037603"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.opensuse.org/show_bug.cgi?id=1037624"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.opensuse.org/show_bug.cgi?id=1038293"
      );
      # https://www.postgresql.org/docs/9.4/static/release-9-4-10.html
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.postgresql.org/docs/9.4/release-9-4-10.html"
      );
      # https://www.postgresql.org/docs/9.4/static/release-9-4-11.html
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.postgresql.org/docs/9.4/release-9-4-11.html"
      );
      # https://www.postgresql.org/docs/9.4/static/release-9-4-12.html
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.postgresql.org/docs/9.4/release-9-4-12.html"
      );
      script_set_attribute(
        attribute:"solution", 
        value:"Update the affected postgresql94 packages."
      );
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:N/A:N");
      script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql94");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql94-contrib");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql94-contrib-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql94-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql94-debugsource");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql94-devel");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql94-devel-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql94-libs-debugsource");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql94-plperl");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql94-plperl-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql94-plpython");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql94-plpython-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql94-pltcl");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql94-pltcl-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql94-server");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql94-server-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:postgresql94-test");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:novell:opensuse:42.2");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2017/07/04");
      script_set_attribute(attribute:"plugin_publication_date", value:"2017/07/05");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2017-2020 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"SuSE Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/SuSE/release", "Host/SuSE/rpm-list", "Host/cpu");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("global_settings.inc");
    include("rpm.inc");
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    release = get_kb_item("Host/SuSE/release");
    if (isnull(release) || release =~ "^(SLED|SLES)") audit(AUDIT_OS_NOT, "openSUSE");
    if (release !~ "^(SUSE42\.2)$") audit(AUDIT_OS_RELEASE_NOT, "openSUSE", "42.2", release);
    if (!get_kb_item("Host/SuSE/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    ourarch = get_kb_item("Host/cpu");
    if (!ourarch) audit(AUDIT_UNKNOWN_ARCH);
    if (ourarch !~ "^(i586|i686|x86_64)$") audit(AUDIT_ARCH_NOT, "i586 / i686 / x86_64", ourarch);
    
    flag = 0;
    
    if ( rpm_check(release:"SUSE42.2", reference:"postgresql94-9.4.12-9.6.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"postgresql94-contrib-9.4.12-9.6.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"postgresql94-contrib-debuginfo-9.4.12-9.6.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"postgresql94-debuginfo-9.4.12-9.6.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"postgresql94-debugsource-9.4.12-9.6.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"postgresql94-devel-9.4.12-9.6.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"postgresql94-devel-debuginfo-9.4.12-9.6.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"postgresql94-libs-debugsource-9.4.12-9.6.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"postgresql94-plperl-9.4.12-9.6.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"postgresql94-plperl-debuginfo-9.4.12-9.6.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"postgresql94-plpython-9.4.12-9.6.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"postgresql94-plpython-debuginfo-9.4.12-9.6.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"postgresql94-pltcl-9.4.12-9.6.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"postgresql94-pltcl-debuginfo-9.4.12-9.6.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"postgresql94-server-9.4.12-9.6.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"postgresql94-server-debuginfo-9.4.12-9.6.1") ) flag++;
    if ( rpm_check(release:"SUSE42.2", reference:"postgresql94-test-9.4.12-9.6.1") ) flag++;
    
    if (flag)
    {
      if (report_verbosity > 0) security_warning(port:0, extra:rpm_report_get());
      else security_warning(0);
      exit(0);
    }
    else
    {
      tested = pkg_tests_get();
      if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
      else audit(AUDIT_PACKAGE_NOT_INSTALLED, "postgresql94-devel / postgresql94-devel-debuginfo / etc");
    }
    
  • NASL familyAmazon Linux Local Security Checks
    NASL idALA_ALAS-2017-838.NASL
    descriptionSelectivity estimators bypass SELECT privilege checks It was found that some selectivity estimation functions 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) pg_user_mappings view discloses foreign server passwords It was found that the pg_user_mappings view from postgresql could disclose information about user mappings to a foreign database to unprivileged users. An authenticated attacker with USAGE privilege for this mapping could, when querying the view, obtain user mapping data, such as the username and password used to connect to the foreign database. (CVE-2017-7486 )
    last seen2020-06-01
    modified2020-06-02
    plugin id100639
    published2017-06-07
    reporterThis script is Copyright (C) 2017-2018 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/100639
    titleAmazon Linux AMI : postgresql92 (ALAS-2017-838)
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were
    # extracted from Amazon Linux AMI Security Advisory ALAS-2017-838.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(100639);
      script_version("3.5");
      script_cvs_date("Date: 2018/04/18 15:09:36");
    
      script_cve_id("CVE-2017-7484", "CVE-2017-7486");
      script_xref(name:"ALAS", value:"2017-838");
    
      script_name(english:"Amazon Linux AMI : postgresql92 (ALAS-2017-838)");
      script_summary(english:"Checks rpm output for the updated packages");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote Amazon Linux AMI host is missing a security update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "Selectivity estimators bypass SELECT privilege checks
    
    It was found that some selectivity estimation functions 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)
    
    pg_user_mappings view discloses foreign server passwords
    
    It was found that the pg_user_mappings view from postgresql could
    disclose information about user mappings to a foreign database to
    unprivileged users. An authenticated attacker with USAGE privilege for
    this mapping could, when querying the view, obtain user mapping data,
    such as the username and password used to connect to the foreign
    database. (CVE-2017-7486 )"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://alas.aws.amazon.com/ALAS-2017-838.html"
      );
      script_set_attribute(
        attribute:"solution", 
        value:"Run 'yum update postgresql92' to update your system."
      );
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:N/A:N");
      script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql92");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql92-contrib");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql92-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql92-devel");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql92-docs");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql92-libs");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql92-plperl");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql92-plpython26");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql92-plpython27");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql92-pltcl");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql92-server");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql92-server-compat");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:postgresql92-test");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:amazon:linux");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2017/06/06");
      script_set_attribute(attribute:"plugin_publication_date", value:"2017/06/07");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2017-2018 Tenable Network Security, Inc.");
      script_family(english:"Amazon Linux Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/AmazonLinux/release", "Host/AmazonLinux/rpm-list");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("global_settings.inc");
    include("rpm.inc");
    
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    
    release = get_kb_item("Host/AmazonLinux/release");
    if (isnull(release) || !strlen(release)) audit(AUDIT_OS_NOT, "Amazon Linux");
    os_ver = pregmatch(pattern: "^AL(A|\d)", string:release);
    if (isnull(os_ver)) audit(AUDIT_UNKNOWN_APP_VER, "Amazon Linux");
    os_ver = os_ver[1];
    if (os_ver != "A")
    {
      if (os_ver == 'A') os_ver = 'AMI';
      audit(AUDIT_OS_NOT, "Amazon Linux AMI", "Amazon Linux " + os_ver);
    }
    
    if (!get_kb_item("Host/AmazonLinux/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    
    flag = 0;
    if (rpm_check(release:"ALA", reference:"postgresql92-9.2.21-1.60.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql92-contrib-9.2.21-1.60.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql92-debuginfo-9.2.21-1.60.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql92-devel-9.2.21-1.60.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql92-docs-9.2.21-1.60.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql92-libs-9.2.21-1.60.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql92-plperl-9.2.21-1.60.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql92-plpython26-9.2.21-1.60.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql92-plpython27-9.2.21-1.60.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql92-pltcl-9.2.21-1.60.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql92-server-9.2.21-1.60.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql92-server-compat-9.2.21-1.60.amzn1")) flag++;
    if (rpm_check(release:"ALA", reference:"postgresql92-test-9.2.21-1.60.amzn1")) flag++;
    
    if (flag)
    {
      if (report_verbosity > 0) security_warning(port:0, extra:rpm_report_get());
      else security_warning(0);
      exit(0);
    }
    else
    {
      tested = pkg_tests_get();
      if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
      else audit(AUDIT_PACKAGE_NOT_INSTALLED, "postgresql92 / postgresql92-contrib / postgresql92-debuginfo / etc");
    }
    
  • NASL familyRed Hat Local Security Checks
    NASL idREDHAT-RHSA-2017-1983.NASL
    descriptionAn update for postgresql is now available for Red Hat Enterprise Linux 7. Red Hat Product Security has rated this update as having a security impact of Moderate. A Common Vulnerability Scoring System (CVSS) base score, which gives a detailed severity rating, is available for each vulnerability from the CVE link(s) in the References section. PostgreSQL is an advanced object-relational database management system (DBMS). The following packages have been upgraded to a later upstream version: postgresql (9.2.21). (BZ#1449706) Security Fix(es) : * It was found that some selectivity estimation functions did not check user privileges before providing information from pg_statistic, possibly leaking information. A non-administrative database user could use this flaw to steal some information from tables they are otherwise not allowed to access. (CVE-2017-7484) * It was found that the pg_user_mappings view could disclose information about user mappings to a foreign database to non-administrative database users. A database user with USAGE privilege for this mapping could, when querying the view, obtain user mapping data, such as the username and password used to connect to the foreign database. (CVE-2017-7486) Red Hat would like to thank the PostgreSQL project for reporting these issues. Upstream acknowledges Robert Haas as the original reporter of CVE-2017-7484; and Andrew Wheelwright as the original reporter of CVE-2017-7486. Additional Changes : For detailed information on changes in this release, see the Red Hat Enterprise Linux 7.4 Release Notes linked from the References section.
    last seen2020-06-01
    modified2020-06-02
    plugin id102108
    published2017-08-02
    reporterThis script is Copyright (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/102108
    titleRHEL 7 : postgresql (RHSA-2017:1983)
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were  
    # extracted from Red Hat Security Advisory RHSA-2017:1983. The text 
    # itself is copyright (C) Red Hat, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(102108);
      script_version("3.18");
      script_cvs_date("Date: 2019/10/24 15:35:43");
    
      script_cve_id("CVE-2017-7484", "CVE-2017-7486");
      script_xref(name:"RHSA", value:"2017:1983");
    
      script_name(english:"RHEL 7 : postgresql (RHSA-2017:1983)");
      script_summary(english:"Checks the rpm output for the updated packages");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote Red Hat host is missing one or more security updates."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "An update for postgresql is now available for Red Hat Enterprise Linux
    7.
    
    Red Hat Product Security has rated this update as having a security
    impact of Moderate. A Common Vulnerability Scoring System (CVSS) base
    score, which gives a detailed severity rating, is available for each
    vulnerability from the CVE link(s) in the References section.
    
    PostgreSQL is an advanced object-relational database management system
    (DBMS).
    
    The following packages have been upgraded to a later upstream version:
    postgresql (9.2.21). (BZ#1449706)
    
    Security Fix(es) :
    
    * It was found that some selectivity estimation functions did not
    check user privileges before providing information from pg_statistic,
    possibly leaking information. A non-administrative database user could
    use this flaw to steal some information from tables they are otherwise
    not allowed to access. (CVE-2017-7484)
    
    * It was found that the pg_user_mappings view could disclose
    information about user mappings to a foreign database to
    non-administrative database users. A database user with USAGE
    privilege for this mapping could, when querying the view, obtain user
    mapping data, such as the username and password used to connect to the
    foreign database. (CVE-2017-7486)
    
    Red Hat would like to thank the PostgreSQL project for reporting these
    issues. Upstream acknowledges Robert Haas as the original reporter of
    CVE-2017-7484; and Andrew Wheelwright as the original reporter of
    CVE-2017-7486.
    
    Additional Changes :
    
    For detailed information on changes in this release, see the Red Hat
    Enterprise Linux 7.4 Release Notes linked from the References section."
      );
      # https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/
      script_set_attribute(
        attribute:"see_also",
        value:"http://www.nessus.org/u?3395ff0b"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.postgresql.org/about/news/1746/"
      );
      # https://www.postgresql.org/docs/current/static/release-9-2-19.html
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.postgresql.org/docs/current/release-9-2-19.html"
      );
      # https://www.postgresql.org/docs/current/static/release-9-2-20.html
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.postgresql.org/docs/current/release-9-2-20.html"
      );
      # https://www.postgresql.org/docs/current/static/release-9-2-21.html
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.postgresql.org/docs/current/release-9-2-21.html"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://access.redhat.com/errata/RHSA-2017:1983"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://access.redhat.com/security/cve/cve-2017-7484"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://access.redhat.com/security/cve/cve-2017-7486"
      );
      script_set_attribute(attribute:"solution", value:"Update the affected packages.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/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:N/UI:N/S:U/C:H/I:N/A:N");
      script_set_cvss3_temporal_vector("CVSS:3.0/E:U/RL:O/RC:C");
      script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"false");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      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:postgresql-contrib");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:postgresql-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:postgresql-devel");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:postgresql-docs");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:postgresql-libs");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:postgresql-plperl");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:postgresql-plpython");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:postgresql-pltcl");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:postgresql-server");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:postgresql-static");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:postgresql-test");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:postgresql-upgrade");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:redhat:enterprise_linux:7");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:redhat:enterprise_linux:7.4");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:redhat:enterprise_linux:7.5");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:redhat:enterprise_linux:7.6");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:redhat:enterprise_linux:7.7");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2017/05/12");
      script_set_attribute(attribute:"patch_publication_date", value:"2017/08/01");
      script_set_attribute(attribute:"plugin_publication_date", value:"2017/08/02");
      script_set_attribute(attribute:"generated_plugin", value:"current");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"Red Hat Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/RedHat/release", "Host/RedHat/rpm-list", "Host/cpu");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("global_settings.inc");
    include("misc_func.inc");
    include("rpm.inc");
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    release = get_kb_item("Host/RedHat/release");
    if (isnull(release) || "Red Hat" >!< release) audit(AUDIT_OS_NOT, "Red Hat");
    os_ver = pregmatch(pattern: "Red Hat Enterprise Linux.*release ([0-9]+(\.[0-9]+)?)", string:release);
    if (isnull(os_ver)) audit(AUDIT_UNKNOWN_APP_VER, "Red Hat");
    os_ver = os_ver[1];
    if (! preg(pattern:"^7([^0-9]|$)", string:os_ver)) audit(AUDIT_OS_NOT, "Red Hat 7.x", "Red Hat " + os_ver);
    
    if (!get_kb_item("Host/RedHat/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    cpu = get_kb_item("Host/cpu");
    if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);
    if ("x86_64" >!< cpu && cpu !~ "^i[3-6]86$" && "s390" >!< cpu) audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "Red Hat", cpu);
    
    yum_updateinfo = get_kb_item("Host/RedHat/yum-updateinfo");
    if (!empty_or_null(yum_updateinfo)) 
    {
      rhsa = "RHSA-2017:1983";
      yum_report = redhat_generate_yum_updateinfo_report(rhsa:rhsa);
      if (!empty_or_null(yum_report))
      {
        security_report_v4(
          port       : 0,
          severity   : SECURITY_WARNING,
          extra      : yum_report 
        );
        exit(0);
      }
      else
      {
        audit_message = "affected by Red Hat security advisory " + rhsa;
        audit(AUDIT_OS_NOT, audit_message);
      }
    }
    else
    {
      flag = 0;
      if (rpm_check(release:"RHEL7", reference:"postgresql-9.2.21-1.el7")) flag++;
    
      if (rpm_check(release:"RHEL7", cpu:"s390x", reference:"postgresql-contrib-9.2.21-1.el7")) flag++;
    
      if (rpm_check(release:"RHEL7", cpu:"x86_64", reference:"postgresql-contrib-9.2.21-1.el7")) flag++;
    
      if (rpm_check(release:"RHEL7", reference:"postgresql-debuginfo-9.2.21-1.el7")) flag++;
    
      if (rpm_check(release:"RHEL7", reference:"postgresql-devel-9.2.21-1.el7")) flag++;
    
      if (rpm_check(release:"RHEL7", cpu:"s390x", reference:"postgresql-docs-9.2.21-1.el7")) flag++;
    
      if (rpm_check(release:"RHEL7", cpu:"x86_64", reference:"postgresql-docs-9.2.21-1.el7")) flag++;
    
      if (rpm_check(release:"RHEL7", reference:"postgresql-libs-9.2.21-1.el7")) flag++;
    
      if (rpm_check(release:"RHEL7", cpu:"s390x", reference:"postgresql-plperl-9.2.21-1.el7")) flag++;
    
      if (rpm_check(release:"RHEL7", cpu:"x86_64", reference:"postgresql-plperl-9.2.21-1.el7")) flag++;
    
      if (rpm_check(release:"RHEL7", cpu:"s390x", reference:"postgresql-plpython-9.2.21-1.el7")) flag++;
    
      if (rpm_check(release:"RHEL7", cpu:"x86_64", reference:"postgresql-plpython-9.2.21-1.el7")) flag++;
    
      if (rpm_check(release:"RHEL7", cpu:"s390x", reference:"postgresql-pltcl-9.2.21-1.el7")) flag++;
    
      if (rpm_check(release:"RHEL7", cpu:"x86_64", reference:"postgresql-pltcl-9.2.21-1.el7")) flag++;
    
      if (rpm_check(release:"RHEL7", cpu:"s390x", reference:"postgresql-server-9.2.21-1.el7")) flag++;
    
      if (rpm_check(release:"RHEL7", cpu:"x86_64", reference:"postgresql-server-9.2.21-1.el7")) flag++;
    
      if (rpm_check(release:"RHEL7", reference:"postgresql-static-9.2.21-1.el7")) flag++;
    
      if (rpm_check(release:"RHEL7", cpu:"s390x", reference:"postgresql-test-9.2.21-1.el7")) flag++;
    
      if (rpm_check(release:"RHEL7", cpu:"x86_64", reference:"postgresql-test-9.2.21-1.el7")) flag++;
    
      if (rpm_check(release:"RHEL7", cpu:"s390x", reference:"postgresql-upgrade-9.2.21-1.el7")) flag++;
    
      if (rpm_check(release:"RHEL7", cpu:"x86_64", reference:"postgresql-upgrade-9.2.21-1.el7")) flag++;
    
    
      if (flag)
      {
        security_report_v4(
          port       : 0,
          severity   : SECURITY_WARNING,
          extra      : rpm_report_get() + redhat_report_package_caveat()
        );
        exit(0);
      }
      else
      {
        tested = pkg_tests_get();
        if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
        else audit(AUDIT_PACKAGE_NOT_INSTALLED, "postgresql / postgresql-contrib / postgresql-debuginfo / etc");
      }
    }
    
  • NASL familyDebian Local Security Checks
    NASL idDEBIAN_DSA-3851.NASL
    descriptionSeveral vulnerabilities have been found in the PostgreSQL database system : - CVE-2017-7484 Robert Haas discovered that some selectivity estimators did not validate user privileges which could result in information disclosure. - CVE-2017-7485 Daniel Gustafsson discovered that the PGREQUIRESSL environment variable did no longer enforce a TLS connection. - CVE-2017-7486 Andrew Wheelwright discovered that user mappings were insufficiently restricted.
    last seen2020-06-01
    modified2020-06-02
    plugin id100165
    published2017-05-15
    reporterThis script is Copyright (C) 2017-2018 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/100165
    titleDebian DSA-3851-1 : postgresql-9.4 - security update
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were  
    # extracted from Debian Security Advisory DSA-3851. The text 
    # itself is copyright (C) Software in the Public Interest, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(100165);
      script_version("3.11");
      script_cvs_date("Date: 2018/11/10 11:49:38");
    
      script_cve_id("CVE-2017-7484", "CVE-2017-7485", "CVE-2017-7486");
      script_xref(name:"DSA", value:"3851");
    
      script_name(english:"Debian DSA-3851-1 : postgresql-9.4 - security update");
      script_summary(english:"Checks dpkg output for the updated package");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote Debian host is missing a security-related update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "Several vulnerabilities have been found in the PostgreSQL database
    system :
    
      - CVE-2017-7484
        Robert Haas discovered that some selectivity estimators
        did not validate user privileges which could result in
        information disclosure.
    
      - CVE-2017-7485
        Daniel Gustafsson discovered that the PGREQUIRESSL
        environment variable did no longer enforce a TLS
        connection.
    
      - CVE-2017-7486
        Andrew Wheelwright discovered that user mappings were
        insufficiently restricted."
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://security-tracker.debian.org/tracker/CVE-2017-7484"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://security-tracker.debian.org/tracker/CVE-2017-7485"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://security-tracker.debian.org/tracker/CVE-2017-7486"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://packages.debian.org/source/jessie/postgresql-9.4"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.debian.org/security/2017/dsa-3851"
      );
      script_set_attribute(
        attribute:"solution", 
        value:
    "Upgrade the postgresql-9.4 packages.
    
    For the stable distribution (jessie), these problems have been fixed
    in version 9.4.12-0+deb8u1."
      );
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/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:N/UI:N/S:U/C:H/I:N/A:N");
      script_set_cvss3_temporal_vector("CVSS:3.0/E:U/RL:O/RC:C");
      script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"false");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:postgresql-9.4");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:debian:debian_linux:8.0");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2017/05/12");
      script_set_attribute(attribute:"plugin_publication_date", value:"2017/05/15");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2017-2018 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"Debian Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/Debian/release", "Host/Debian/dpkg-l");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("debian_package.inc");
    
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    if (!get_kb_item("Host/Debian/release")) audit(AUDIT_OS_NOT, "Debian");
    if (!get_kb_item("Host/Debian/dpkg-l")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    
    flag = 0;
    if (deb_check(release:"8.0", prefix:"libecpg-compat3", reference:"9.4.12-0+deb8u1")) flag++;
    if (deb_check(release:"8.0", prefix:"libecpg-dev", reference:"9.4.12-0+deb8u1")) flag++;
    if (deb_check(release:"8.0", prefix:"libecpg6", reference:"9.4.12-0+deb8u1")) flag++;
    if (deb_check(release:"8.0", prefix:"libpgtypes3", reference:"9.4.12-0+deb8u1")) flag++;
    if (deb_check(release:"8.0", prefix:"libpq-dev", reference:"9.4.12-0+deb8u1")) flag++;
    if (deb_check(release:"8.0", prefix:"libpq5", reference:"9.4.12-0+deb8u1")) flag++;
    if (deb_check(release:"8.0", prefix:"postgresql-9.4", reference:"9.4.12-0+deb8u1")) flag++;
    if (deb_check(release:"8.0", prefix:"postgresql-9.4-dbg", reference:"9.4.12-0+deb8u1")) flag++;
    if (deb_check(release:"8.0", prefix:"postgresql-client-9.4", reference:"9.4.12-0+deb8u1")) flag++;
    if (deb_check(release:"8.0", prefix:"postgresql-contrib-9.4", reference:"9.4.12-0+deb8u1")) flag++;
    if (deb_check(release:"8.0", prefix:"postgresql-doc-9.4", reference:"9.4.12-0+deb8u1")) flag++;
    if (deb_check(release:"8.0", prefix:"postgresql-plperl-9.4", reference:"9.4.12-0+deb8u1")) flag++;
    if (deb_check(release:"8.0", prefix:"postgresql-plpython-9.4", reference:"9.4.12-0+deb8u1")) flag++;
    if (deb_check(release:"8.0", prefix:"postgresql-plpython3-9.4", reference:"9.4.12-0+deb8u1")) flag++;
    if (deb_check(release:"8.0", prefix:"postgresql-pltcl-9.4", reference:"9.4.12-0+deb8u1")) flag++;
    if (deb_check(release:"8.0", prefix:"postgresql-server-dev-9.4", reference:"9.4.12-0+deb8u1")) flag++;
    
    if (flag)
    {
      if (report_verbosity > 0) security_warning(port:0, extra:deb_report_get());
      else security_warning(0);
      exit(0);
    }
    else audit(AUDIT_HOST_NOT, "affected");
    
  • NASL familyHuawei Local Security Checks
    NASL idEULEROS_SA-2017-1216.NASL
    descriptionAccording to the versions of the posrgresql packages installed, the EulerOS installation on the remote host is affected by the following vulnerabilities : - It was found that some selectivity estimation functions did not check user privileges before providing information from pg_statistic, possibly leaking information. A non-administrative database user could use this flaw to steal some information from tables they are otherwise not allowed to access. (CVE-2017-7484) - It was found that the pg_user_mappings view could disclose information about user mappings to a foreign database to non-administrative database users. A database user with USAGE privilege for this mapping could, when querying the view, obtain user mapping data, such as the username and password used to connect to the foreign database. (CVE-2017-7486) Note that Tenable Network Security has extracted the preceding description block directly from the EulerOS security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen2020-05-06
    modified2017-09-11
    plugin id103074
    published2017-09-11
    reporterThis script is Copyright (C) 2017-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/103074
    titleEulerOS 2.0 SP2 : posrgresql (EulerOS-SA-2017-1216)
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(103074);
      script_version("3.11");
      script_set_attribute(attribute:"plugin_modification_date", value:"2020/05/04");
    
      script_cve_id(
        "CVE-2017-7484",
        "CVE-2017-7486"
      );
    
      script_name(english:"EulerOS 2.0 SP2 : posrgresql (EulerOS-SA-2017-1216)");
      script_summary(english:"Checks the rpm output for the updated packages.");
    
      script_set_attribute(attribute:"synopsis", value:
    "The remote EulerOS host is missing multiple security updates.");
      script_set_attribute(attribute:"description", value:
    "According to the versions of the posrgresql packages installed, the
    EulerOS installation on the remote host is affected by the following
    vulnerabilities :
    
      - It was found that some selectivity estimation functions
        did not check user privileges before providing
        information from pg_statistic, possibly leaking
        information. A non-administrative database user could
        use this flaw to steal some information from tables
        they are otherwise not allowed to access.
        (CVE-2017-7484)
    
      - It was found that the pg_user_mappings view could
        disclose information about user mappings to a foreign
        database to non-administrative database users. A
        database user with USAGE privilege for this mapping
        could, when querying the view, obtain user mapping
        data, such as the username and password used to connect
        to the foreign database. (CVE-2017-7486)
    
    Note that Tenable Network Security has extracted the preceding
    description block directly from the EulerOS security advisory. Tenable
    has attempted to automatically clean and format it as much as possible
    without introducing additional issues.");
      # https://developer.huaweicloud.com/ict/en/site-euleros/euleros/security-advisories/EulerOS-SA-2017-1216
      script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?34837add");
      script_set_attribute(attribute:"solution", value:
    "Update the affected posrgresql packages.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/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:N/UI:N/S:U/C:H/I:N/A:N");
      script_set_cvss3_temporal_vector("CVSS:3.0/E:U/RL:O/RC:C");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2017/08/28");
      script_set_attribute(attribute:"plugin_publication_date", value:"2017/09/11");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:huawei:euleros:postgresql");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:huawei:euleros:postgresql-contrib");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:huawei:euleros:postgresql-devel");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:huawei:euleros:postgresql-docs");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:huawei:euleros:postgresql-libs");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:huawei:euleros:postgresql-plperl");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:huawei:euleros:postgresql-plpython");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:huawei:euleros:postgresql-pltcl");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:huawei:euleros:postgresql-server");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:huawei:euleros:postgresql-test");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:huawei:euleros:2.0");
      script_set_attribute(attribute:"generated_plugin", value:"current");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_family(english:"Huawei Local Security Checks");
    
      script_copyright(english:"This script is Copyright (C) 2017-2020 and is owned by Tenable, Inc. or an Affiliate thereof.");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/EulerOS/release", "Host/EulerOS/rpm-list", "Host/EulerOS/sp");
      script_exclude_keys("Host/EulerOS/uvp_version");
    
      exit(0);
    }
    
    include("audit.inc");
    include("global_settings.inc");
    include("rpm.inc");
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    
    release = get_kb_item("Host/EulerOS/release");
    if (isnull(release) || release !~ "^EulerOS") audit(AUDIT_OS_NOT, "EulerOS");
    if (release !~ "^EulerOS release 2\.0(\D|$)") audit(AUDIT_OS_NOT, "EulerOS 2.0");
    
    sp = get_kb_item("Host/EulerOS/sp");
    if (isnull(sp) || sp !~ "^(2)$") audit(AUDIT_OS_NOT, "EulerOS 2.0 SP2");
    
    uvp = get_kb_item("Host/EulerOS/uvp_version");
    if (!empty_or_null(uvp)) audit(AUDIT_OS_NOT, "EulerOS 2.0 SP2", "EulerOS UVP " + uvp);
    
    if (!get_kb_item("Host/EulerOS/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    cpu = get_kb_item("Host/cpu");
    if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);
    if ("x86_64" >!< cpu && cpu !~ "^i[3-6]86$" && "aarch64" >!< cpu) audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "EulerOS", cpu);
    if ("x86_64" >!< cpu && cpu !~ "^i[3-6]86$") audit(AUDIT_ARCH_NOT, "i686 / x86_64", cpu);
    
    flag = 0;
    
    pkgs = ["postgresql-9.2.21-1",
            "postgresql-contrib-9.2.21-1",
            "postgresql-devel-9.2.21-1",
            "postgresql-docs-9.2.21-1",
            "postgresql-libs-9.2.21-1",
            "postgresql-plperl-9.2.21-1",
            "postgresql-plpython-9.2.21-1",
            "postgresql-pltcl-9.2.21-1",
            "postgresql-server-9.2.21-1",
            "postgresql-test-9.2.21-1"];
    
    foreach (pkg in pkgs)
      if (rpm_check(release:"EulerOS-2.0", sp:"2", reference:pkg)) flag++;
    
    if (flag)
    {
      security_report_v4(
        port       : 0,
        severity   : SECURITY_WARNING,
        extra      : rpm_report_get()
      );
      exit(0);
    }
    else
    {
      tested = pkg_tests_get();
      if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
      else audit(AUDIT_PACKAGE_NOT_INSTALLED, "posrgresql");
    }
    
  • NASL familyRed Hat Local Security Checks
    NASL idREDHAT-RHSA-2017-1838.NASL
    descriptionAn update for rh-postgresql95-postgresql is now available for Red Hat Satellite 5.8 and Red Hat Satellite 5.8 ELS. Red Hat Product Security has rated this update as having a security impact of Moderate. A Common Vulnerability Scoring System (CVSS) base score, which gives a detailed severity rating, is available for each vulnerability from the CVE link(s) in the References section. This update applies only to Satellite 5.8 instances using either embedded or managed PostgreSQL databases. There are manual steps required in order to finish the migration from postgresql92-postgresql to rh-postgresql95-postgresql. If these steps are not undertaken, the affected Satellite will continue to use PostgreSQL 9.2. postgresql92-postgresql will be upgraded automatically to rh-postgresql95-postgresql as part of an upgrade to Satellite 5.8. PostgreSQL is an advanced object-relational database management system (DBMS). Security Fix(es) : * It was found that some selectivity estimation functions did not check user privileges before providing information from pg_statistic, possibly leaking information. A non-administrative database user could use this flaw to steal some information from tables they are otherwise not allowed to access. (CVE-2017-7484) * It was discovered that the PostgreSQL client library (libpq) did not enforce the use of TLS/SSL for a connection to a PostgreSQL server when the PGREQUIRESSL environment variable was set. An man-in-the-middle attacker could use this flaw to strip the SSL/TLS protection from a connection between a client and a server. (CVE-2017-7485) * It was found that the pg_user_mappings view could disclose information about user mappings to a foreign database to non-administrative database users. A database user with USAGE privilege for this mapping could, when querying the view, obtain user mapping data, such as the username and password used to connect to the foreign database. (CVE-2017-7486) Red Hat would like to thank the PostgreSQL project for reporting these issues. Upstream acknowledges Robert Haas as the original reporter of CVE-2017-7484; Daniel Gustafsson as the original reporter of CVE-2017-7485; and Andrew Wheelwright as the original reporter of CVE-2017-7486.
    last seen2020-06-01
    modified2020-06-02
    plugin id102142
    published2017-08-03
    reporterThis script is Copyright (C) 2017-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/102142
    titleRHEL 5 : rh-postgresql95-postgresql (RHSA-2017:1838)
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were  
    # extracted from Red Hat Security Advisory RHSA-2017:1838. The text 
    # itself is copyright (C) Red Hat, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(102142);
      script_version("3.8");
      script_cvs_date("Date: 2019/10/24 15:35:43");
    
      script_cve_id("CVE-2017-7484", "CVE-2017-7485", "CVE-2017-7486");
      script_xref(name:"RHSA", value:"2017:1838");
    
      script_name(english:"RHEL 5 : rh-postgresql95-postgresql (RHSA-2017:1838)");
      script_summary(english:"Checks the rpm output for the updated packages");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote Red Hat host is missing one or more security updates."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "An update for rh-postgresql95-postgresql is now available for Red Hat
    Satellite 5.8 and Red Hat Satellite 5.8 ELS.
    
    Red Hat Product Security has rated this update as having a security
    impact of Moderate. A Common Vulnerability Scoring System (CVSS) base
    score, which gives a detailed severity rating, is available for each
    vulnerability from the CVE link(s) in the References section.
    
    This update applies only to Satellite 5.8 instances using either
    embedded or managed PostgreSQL databases.
    
    There are manual steps required in order to finish the migration from
    postgresql92-postgresql to rh-postgresql95-postgresql. If these steps
    are not undertaken, the affected Satellite will continue to use
    PostgreSQL 9.2.
    
    postgresql92-postgresql will be upgraded automatically to
    rh-postgresql95-postgresql as part of an upgrade to Satellite 5.8.
    
    PostgreSQL is an advanced object-relational database management system
    (DBMS).
    
    Security Fix(es) :
    
    * It was found that some selectivity estimation functions did not
    check user privileges before providing information from pg_statistic,
    possibly leaking information. A non-administrative database user could
    use this flaw to steal some information from tables they are otherwise
    not allowed to access. (CVE-2017-7484)
    
    * It was discovered that the PostgreSQL client library (libpq) did not
    enforce the use of TLS/SSL for a connection to a PostgreSQL server
    when the PGREQUIRESSL environment variable was set. An
    man-in-the-middle attacker could use this flaw to strip the SSL/TLS
    protection from a connection between a client and a server.
    (CVE-2017-7485)
    
    * It was found that the pg_user_mappings view could disclose
    information about user mappings to a foreign database to
    non-administrative database users. A database user with USAGE
    privilege for this mapping could, when querying the view, obtain user
    mapping data, such as the username and password used to connect to the
    foreign database. (CVE-2017-7486)
    
    Red Hat would like to thank the PostgreSQL project for reporting these
    issues. Upstream acknowledges Robert Haas as the original reporter of
    CVE-2017-7484; Daniel Gustafsson as the original reporter of
    CVE-2017-7485; and Andrew Wheelwright as the original reporter of
    CVE-2017-7486."
      );
      script_set_attribute(
        attribute:"see_also",
        value:"http://rhn.redhat.com/errata/RHSA-2017-1838.html"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.redhat.com/security/data/cve/CVE-2017-7484.html"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.redhat.com/security/data/cve/CVE-2017-7485.html"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.redhat.com/security/data/cve/CVE-2017-7486.html"
      );
      script_set_attribute(attribute:"solution", value:"Update the affected packages.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:N/A:N");
      script_set_cvss_temporal_vector("CVSS2#E:U/RL:OF/RC:C");
      script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"false");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:rh-postgresql95-postgresql");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:rh-postgresql95-postgresql-contrib");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:rh-postgresql95-postgresql-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:rh-postgresql95-postgresql-libs");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:rh-postgresql95-postgresql-pltcl");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:rh-postgresql95-postgresql-server");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:redhat:enterprise_linux:5.8");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2017/07/31");
      script_set_attribute(attribute:"plugin_publication_date", value:"2017/08/03");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2017-2019 Tenable Network Security, Inc.");
      script_family(english:"Red Hat Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/RedHat/release", "Host/RedHat/rpm-list", "Host/cpu");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("global_settings.inc");
    include("misc_func.inc");
    include("rpm.inc");
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    release = get_kb_item("Host/RedHat/release");
    if (isnull(release) || "Red Hat" >!< release) audit(AUDIT_OS_NOT, "Red Hat");
    os_ver = eregmatch(pattern: "Red Hat Enterprise Linux.*release ([0-9]+(\.[0-9]+)?)", string:release);
    if (isnull(os_ver)) audit(AUDIT_UNKNOWN_APP_VER, "Red Hat");
    os_ver = os_ver[1];
    if (! ereg(pattern:"^5\.8([^0-9]|$)", string:os_ver)) audit(AUDIT_OS_NOT, "Red Hat 5.8", "Red Hat " + os_ver);
    
    if (!get_kb_item("Host/RedHat/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    cpu = get_kb_item("Host/cpu");
    if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);
    if ("x86_64" >!< cpu && cpu !~ "^i[3-6]86$" && "s390" >!< cpu) audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "Red Hat", cpu);
    
    yum_updateinfo = get_kb_item("Host/RedHat/yum-updateinfo");
    if (!empty_or_null(yum_updateinfo)) 
    {
      rhsa = "RHSA-2017:1838";
      yum_report = redhat_generate_yum_updateinfo_report(rhsa:rhsa);
      if (!empty_or_null(yum_report))
      {
        security_report_v4(
          port       : 0,
          severity   : SECURITY_WARNING,
          extra      : yum_report 
        );
        exit(0);
      }
      else
      {
        audit_message = "affected by Red Hat security advisory " + rhsa;
        audit(AUDIT_OS_NOT, audit_message);
      }
    }
    else
    {
      flag = 0;
      if (rpm_check(release:"RHEL5", sp:"8", cpu:"s390x", reference:"rh-postgresql95-postgresql-9.5.7-2.el6")) flag++;
      if (rpm_check(release:"RHEL5", sp:"8", cpu:"x86_64", reference:"rh-postgresql95-postgresql-9.5.7-2.el6")) flag++;
      if (rpm_check(release:"RHEL5", sp:"8", cpu:"s390x", reference:"rh-postgresql95-postgresql-contrib-9.5.7-2.el6")) flag++;
      if (rpm_check(release:"RHEL5", sp:"8", cpu:"x86_64", reference:"rh-postgresql95-postgresql-contrib-9.5.7-2.el6")) flag++;
      if (rpm_check(release:"RHEL5", sp:"8", cpu:"s390x", reference:"rh-postgresql95-postgresql-debuginfo-9.5.7-2.el6")) flag++;
      if (rpm_check(release:"RHEL5", sp:"8", cpu:"x86_64", reference:"rh-postgresql95-postgresql-debuginfo-9.5.7-2.el6")) flag++;
      if (rpm_check(release:"RHEL5", sp:"8", cpu:"s390x", reference:"rh-postgresql95-postgresql-libs-9.5.7-2.el6")) flag++;
      if (rpm_check(release:"RHEL5", sp:"8", cpu:"x86_64", reference:"rh-postgresql95-postgresql-libs-9.5.7-2.el6")) flag++;
      if (rpm_check(release:"RHEL5", sp:"8", cpu:"s390x", reference:"rh-postgresql95-postgresql-pltcl-9.5.7-2.el6")) flag++;
      if (rpm_check(release:"RHEL5", sp:"8", cpu:"x86_64", reference:"rh-postgresql95-postgresql-pltcl-9.5.7-2.el6")) flag++;
      if (rpm_check(release:"RHEL5", sp:"8", cpu:"s390x", reference:"rh-postgresql95-postgresql-server-9.5.7-2.el6")) flag++;
      if (rpm_check(release:"RHEL5", sp:"8", cpu:"x86_64", reference:"rh-postgresql95-postgresql-server-9.5.7-2.el6")) flag++;
    
      if (flag)
      {
        security_report_v4(
          port       : 0,
          severity   : SECURITY_WARNING,
          extra      : rpm_report_get() + redhat_report_package_caveat()
        );
        exit(0);
      }
      else
      {
        tested = pkg_tests_get();
        if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
        else audit(AUDIT_PACKAGE_NOT_INSTALLED, "rh-postgresql95-postgresql / rh-postgresql95-postgresql-contrib / etc");
      }
    }
    
  • NASL familyDatabases
    NASL idPOSTGRESQL_20170511.NASL
    descriptionThe version of PostgreSQL installed on the remote host is 9.2.x prior to 9.2.21, 9.3.x prior to 9.3.17, 9.4.x prior to 9.4.12, 9.5.x prior to 9.5.7, or 9.6.x prior to 9.6.3. It is, therefore, affected by multiple vulnerabilities : - A information disclosure vulnerability exists in unspecified selectivity estimation functions due to improper checking of user privileges before providing information from pg_statistics. An authenticated, remote attacker can exploit this to disclose potentially sensitive information from restricted tables. (CVE-2017-7484) - A flaw exists because the PGREQUIRESSL environment variable setting is not properly honored, which results in a failure to require appropriate SSL/TLS connections. A man-in-the-middle attacker can exploit this to cause an insecure, non-SSL/TLS connection between a client and and a server. Note that version 9.2.x is not affected by this vulnerability. (CVE-2017-7485) - A information disclosure vulnerability exists in the pg_user_mappings view that allows access to user mappings which may contain passwords that have persisted from the CREATE USER MAPPING command. An authenticated, remote attacker who has USAGE privilege on the associated foreign server can exploit this to disclose foreign server passwords. (CVE-2017-7486)
    last seen2020-06-01
    modified2020-06-02
    plugin id100260
    published2017-05-17
    reporterThis script is Copyright (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/100260
    titlePostgreSQL 9.2.x < 9.2.21 / 9.3.x < 9.3.17 / 9.4.x < 9.4.12 / 9.5.x < 9.5.7 / 9.6.x < 9.6.3 Multiple Vulnerabilities
    code
    #
    # (C) Tenable Network Security, Inc
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(100260);
      script_version("1.14");
      script_cvs_date("Date: 2019/11/13");
    
      script_cve_id("CVE-2017-7484", "CVE-2017-7485", "CVE-2017-7486");
      script_bugtraq_id(98459, 98460, 98461);
    
      script_name(english:"PostgreSQL 9.2.x < 9.2.21 / 9.3.x < 9.3.17 / 9.4.x < 9.4.12 / 9.5.x < 9.5.7 / 9.6.x < 9.6.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.2.x prior
    to 9.2.21, 9.3.x prior to 9.3.17, 9.4.x prior to 9.4.12, 9.5.x prior
    to 9.5.7, or 9.6.x prior to 9.6.3. It is, therefore, affected by
    multiple vulnerabilities :
    
      - A information disclosure vulnerability exists in
        unspecified selectivity estimation functions due to
        improper checking of user privileges before providing
        information from pg_statistics. An authenticated, remote
        attacker can exploit this to disclose potentially
        sensitive information from restricted tables.
        (CVE-2017-7484)
    
      - A flaw exists because the PGREQUIRESSL environment
        variable setting is not properly honored, which results
        in a failure to require appropriate SSL/TLS connections.
        A man-in-the-middle attacker can exploit this to cause
        an insecure, non-SSL/TLS connection between a client and
        and a server. Note that version 9.2.x is not affected by
        this vulnerability. (CVE-2017-7485)
    
      - A information disclosure vulnerability exists in the
        pg_user_mappings view that allows access to user
        mappings which may contain passwords that have persisted
        from the CREATE USER MAPPING command. An authenticated,
        remote attacker who has USAGE privilege on the
        associated foreign server can exploit this to disclose
        foreign server passwords. (CVE-2017-7486)");
      script_set_attribute(attribute:"see_also", value:"https://www.postgresql.org/about/news/1746/");
      script_set_attribute(attribute:"see_also", value:"https://www.postgresql.org/docs/current/static/release-9-2-21.html");
      script_set_attribute(attribute:"see_also", value:"https://www.postgresql.org/docs/current/release-9-3-17.html");
      script_set_attribute(attribute:"see_also", value:"https://www.postgresql.org/docs/current/release-9-4-12.html");
      script_set_attribute(attribute:"see_also", value:"https://www.postgresql.org/docs/current/release-9-5-7.html");
      script_set_attribute(attribute:"see_also", value:"https://www.postgresql.org/docs/current/release-9-6-3.html");
      script_set_attribute(attribute:"solution", value:
    "Upgrade to PostgreSQL version 9.2.21 / 9.3.17 / 9.4.12 / 9.5.7 / 9.6.3
    or later.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/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:N/UI:N/S:U/C:H/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-2017-7486");
    
      script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"false");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2017/05/11");
      script_set_attribute(attribute:"patch_publication_date", value:"2017/05/11");
      script_set_attribute(attribute:"plugin_publication_date", value:"2017/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) 2017-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("vcf_extras.inc");
    include("backport.inc");
    
    port = get_service(svc:"postgresql", default:5432, exit_on_fail:TRUE);
    kb_backported = NULL;
    
    version = get_kb_item_or_exit('database/'+port+'/postgresql/version');
    source = get_kb_item_or_exit('database/'+port+'/postgresql/source');
    kb_base = "database/"+port+"/postgresql/";
    
    get_backport_banner(banner:source);
    if (backported)
    {
      if (report_paranoia < 2) audit(AUDIT_BACKPORT_SERVICE, port, 'PostgreSQL server');
      kb_backported = kb_base +"backported";
    }
    
    app_info = vcf::get_app_info(app:"PostgreSQL", port:port, kb_ver:kb_base+"version", kb_backport:kb_backported, service:TRUE);  
    
    #  9.2.21 / 9.3.17 / 9.4.12 / 9.5.7 / 9.6.3
    constraints = [
      { "min_version" : "9.2", "fixed_version" : "9.2.21" },
      { "min_version" : "9.3", "fixed_version" : "9.3.17" },
      { "min_version" : "9.4", "fixed_version" : "9.4.12" },
      { "min_version" : "9.5", "fixed_version" : "9.5.7" },
      { "min_version" : "9.6", "fixed_version" : "9.6.3" }
    ];
    
    vcf::postgresql::check_version_and_report(app_info:app_info, constraints:constraints, severity:SECURITY_WARNING);
    
  • NASL familyScientific Linux Local Security Checks
    NASL idSL_20170801_POSTGRESQL_ON_SL7_X.NASL
    descriptionThe following packages have been upgraded to a later upstream version: postgresql (9.2.21). Security Fix(es) : - It was found that some selectivity estimation functions did not check user privileges before providing information from pg_statistic, possibly leaking information. A non-administrative database user could use this flaw to steal some information from tables they are otherwise not allowed to access. (CVE-2017-7484) - It was found that the pg_user_mappings view could disclose information about user mappings to a foreign database to non-administrative database users. A database user with USAGE privilege for this mapping could, when querying the view, obtain user mapping data, such as the username and password used to connect to the foreign database. (CVE-2017-7486)
    last seen2020-03-18
    modified2017-08-22
    plugin id102653
    published2017-08-22
    reporterThis script is Copyright (C) 2017-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/102653
    titleScientific Linux Security Update : postgresql on SL7.x x86_64 (20170801)
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text is (C) Scientific Linux.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(102653);
      script_version("3.4");
      script_set_attribute(attribute:"plugin_modification_date", value:"2020/02/25");
    
      script_cve_id("CVE-2017-7484", "CVE-2017-7486");
    
      script_name(english:"Scientific Linux Security Update : postgresql on SL7.x x86_64 (20170801)");
      script_summary(english:"Checks rpm output for the updated packages");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:
    "The remote Scientific Linux host is missing one or more security
    updates."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "The following packages have been upgraded to a later upstream version:
    postgresql (9.2.21).
    
    Security Fix(es) :
    
      - It was found that some selectivity estimation functions
        did not check user privileges before providing
        information from pg_statistic, possibly leaking
        information. A non-administrative database user could
        use this flaw to steal some information from tables they
        are otherwise not allowed to access. (CVE-2017-7484)
    
      - It was found that the pg_user_mappings view could
        disclose information about user mappings to a foreign
        database to non-administrative database users. A
        database user with USAGE privilege for this mapping
        could, when querying the view, obtain user mapping data,
        such as the username and password used to connect to the
        foreign database. (CVE-2017-7486)"
      );
      # https://listserv.fnal.gov/scripts/wa.exe?A2=ind1708&L=scientific-linux-errata&F=&S=&P=17812
      script_set_attribute(
        attribute:"see_also",
        value:"http://www.nessus.org/u?89dae100"
      );
      script_set_attribute(attribute:"solution", value:"Update the affected packages.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:N/A:N");
      script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:fermilab:scientific_linux:postgresql");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:fermilab:scientific_linux:postgresql-contrib");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:fermilab:scientific_linux:postgresql-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:fermilab:scientific_linux:postgresql-devel");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:fermilab:scientific_linux:postgresql-docs");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:fermilab:scientific_linux:postgresql-libs");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:fermilab:scientific_linux:postgresql-plperl");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:fermilab:scientific_linux:postgresql-plpython");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:fermilab:scientific_linux:postgresql-pltcl");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:fermilab:scientific_linux:postgresql-server");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:fermilab:scientific_linux:postgresql-static");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:fermilab:scientific_linux:postgresql-test");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:fermilab:scientific_linux:postgresql-upgrade");
      script_set_attribute(attribute:"cpe", value:"x-cpe:/o:fermilab:scientific_linux");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2017/05/12");
      script_set_attribute(attribute:"patch_publication_date", value:"2017/08/01");
      script_set_attribute(attribute:"plugin_publication_date", value:"2017/08/22");
      script_set_attribute(attribute:"generated_plugin", value:"current");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2017-2020 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"Scientific Linux Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/cpu", "Host/RedHat/release", "Host/RedHat/rpm-list");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("global_settings.inc");
    include("misc_func.inc");
    include("rpm.inc");
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    release = get_kb_item("Host/RedHat/release");
    if (isnull(release) || "Scientific Linux " >!< release) audit(AUDIT_HOST_NOT, "running Scientific Linux");
    os_ver = pregmatch(pattern: "Scientific Linux.*release ([0-9]+(\.[0-9]+)?)", string:release);
    if (isnull(os_ver)) audit(AUDIT_UNKNOWN_APP_VER, "Scientific Linux");
    os_ver = os_ver[1];
    if (! preg(pattern:"^7([^0-9]|$)", string:os_ver)) audit(AUDIT_OS_NOT, "Scientific Linux 7.x", "Scientific Linux " + os_ver);
    if (!get_kb_item("Host/RedHat/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    cpu = get_kb_item("Host/cpu");
    if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);
    if (cpu >!< "x86_64" && cpu !~ "^i[3-6]86$") audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "Scientific Linux", cpu);
    if ("x86_64" >!< cpu) audit(AUDIT_ARCH_NOT, "x86_64", cpu);
    
    
    flag = 0;
    if (rpm_check(release:"SL7", cpu:"x86_64", reference:"postgresql-9.2.21-1.el7")) flag++;
    if (rpm_check(release:"SL7", cpu:"x86_64", reference:"postgresql-contrib-9.2.21-1.el7")) flag++;
    if (rpm_check(release:"SL7", cpu:"x86_64", reference:"postgresql-debuginfo-9.2.21-1.el7")) flag++;
    if (rpm_check(release:"SL7", cpu:"x86_64", reference:"postgresql-devel-9.2.21-1.el7")) flag++;
    if (rpm_check(release:"SL7", cpu:"x86_64", reference:"postgresql-docs-9.2.21-1.el7")) flag++;
    if (rpm_check(release:"SL7", cpu:"x86_64", reference:"postgresql-libs-9.2.21-1.el7")) flag++;
    if (rpm_check(release:"SL7", cpu:"x86_64", reference:"postgresql-plperl-9.2.21-1.el7")) flag++;
    if (rpm_check(release:"SL7", cpu:"x86_64", reference:"postgresql-plpython-9.2.21-1.el7")) flag++;
    if (rpm_check(release:"SL7", cpu:"x86_64", reference:"postgresql-pltcl-9.2.21-1.el7")) flag++;
    if (rpm_check(release:"SL7", cpu:"x86_64", reference:"postgresql-server-9.2.21-1.el7")) flag++;
    if (rpm_check(release:"SL7", cpu:"x86_64", reference:"postgresql-static-9.2.21-1.el7")) flag++;
    if (rpm_check(release:"SL7", cpu:"x86_64", reference:"postgresql-test-9.2.21-1.el7")) flag++;
    if (rpm_check(release:"SL7", cpu:"x86_64", reference:"postgresql-upgrade-9.2.21-1.el7")) flag++;
    
    
    if (flag)
    {
      security_report_v4(
        port       : 0,
        severity   : SECURITY_WARNING,
        extra      : rpm_report_get()
      );
      exit(0);
    }
    else
    {
      tested = pkg_tests_get();
      if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
      else audit(AUDIT_PACKAGE_NOT_INSTALLED, "postgresql / postgresql-contrib / postgresql-debuginfo / etc");
    }
    
  • NASL familyCentOS Local Security Checks
    NASL idCENTOS_RHSA-2017-1983.NASL
    descriptionAn update for postgresql is now available for Red Hat Enterprise Linux 7. Red Hat Product Security has rated this update as having a security impact of Moderate. A Common Vulnerability Scoring System (CVSS) base score, which gives a detailed severity rating, is available for each vulnerability from the CVE link(s) in the References section. PostgreSQL is an advanced object-relational database management system (DBMS). The following packages have been upgraded to a later upstream version: postgresql (9.2.21). (BZ#1449706) Security Fix(es) : * It was found that some selectivity estimation functions did not check user privileges before providing information from pg_statistic, possibly leaking information. A non-administrative database user could use this flaw to steal some information from tables they are otherwise not allowed to access. (CVE-2017-7484) * It was found that the pg_user_mappings view could disclose information about user mappings to a foreign database to non-administrative database users. A database user with USAGE privilege for this mapping could, when querying the view, obtain user mapping data, such as the username and password used to connect to the foreign database. (CVE-2017-7486) Red Hat would like to thank the PostgreSQL project for reporting these issues. Upstream acknowledges Robert Haas as the original reporter of CVE-2017-7484; and Andrew Wheelwright as the original reporter of CVE-2017-7486. Additional Changes : For detailed information on changes in this release, see the Red Hat Enterprise Linux 7.4 Release Notes linked from the References section.
    last seen2020-06-01
    modified2020-06-02
    plugin id102747
    published2017-08-25
    reporterThis script is Copyright (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/102747
    titleCentOS 7 : postgresql (CESA-2017:1983)
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were  
    # extracted from Red Hat Security Advisory RHSA-2017:1983 and 
    # CentOS Errata and Security Advisory 2017:1983 respectively.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(102747);
      script_version("3.6");
      script_cvs_date("Date: 2019/12/31");
    
      script_cve_id("CVE-2017-7484", "CVE-2017-7486");
      script_xref(name:"RHSA", value:"2017:1983");
    
      script_name(english:"CentOS 7 : postgresql (CESA-2017:1983)");
      script_summary(english:"Checks rpm output for the updated packages");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote CentOS host is missing one or more security updates."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "An update for postgresql is now available for Red Hat Enterprise Linux
    7.
    
    Red Hat Product Security has rated this update as having a security
    impact of Moderate. A Common Vulnerability Scoring System (CVSS) base
    score, which gives a detailed severity rating, is available for each
    vulnerability from the CVE link(s) in the References section.
    
    PostgreSQL is an advanced object-relational database management system
    (DBMS).
    
    The following packages have been upgraded to a later upstream version:
    postgresql (9.2.21). (BZ#1449706)
    
    Security Fix(es) :
    
    * It was found that some selectivity estimation functions did not
    check user privileges before providing information from pg_statistic,
    possibly leaking information. A non-administrative database user could
    use this flaw to steal some information from tables they are otherwise
    not allowed to access. (CVE-2017-7484)
    
    * It was found that the pg_user_mappings view could disclose
    information about user mappings to a foreign database to
    non-administrative database users. A database user with USAGE
    privilege for this mapping could, when querying the view, obtain user
    mapping data, such as the username and password used to connect to the
    foreign database. (CVE-2017-7486)
    
    Red Hat would like to thank the PostgreSQL project for reporting these
    issues. Upstream acknowledges Robert Haas as the original reporter of
    CVE-2017-7484; and Andrew Wheelwright as the original reporter of
    CVE-2017-7486.
    
    Additional Changes :
    
    For detailed information on changes in this release, see the Red Hat
    Enterprise Linux 7.4 Release Notes linked from the References section."
      );
      # https://lists.centos.org/pipermail/centos-cr-announce/2017-August/004454.html
      script_set_attribute(
        attribute:"see_also",
        value:"http://www.nessus.org/u?b8cccbdd"
      );
      script_set_attribute(
        attribute:"solution", 
        value:"Update the affected postgresql packages."
      );
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/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:N/UI:N/S:U/C:H/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-2017-7484");
      script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"false");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:centos:centos:postgresql");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:centos:centos:postgresql-contrib");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:centos:centos:postgresql-devel");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:centos:centos:postgresql-docs");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:centos:centos:postgresql-libs");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:centos:centos:postgresql-plperl");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:centos:centos:postgresql-plpython");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:centos:centos:postgresql-pltcl");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:centos:centos:postgresql-server");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:centos:centos:postgresql-static");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:centos:centos:postgresql-test");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:centos:centos:postgresql-upgrade");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:centos:centos:7");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2017/05/12");
      script_set_attribute(attribute:"patch_publication_date", value:"2017/08/23");
      script_set_attribute(attribute:"plugin_publication_date", value:"2017/08/25");
      script_set_attribute(attribute:"generated_plugin", value:"current");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"CentOS Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/CentOS/release", "Host/CentOS/rpm-list");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("global_settings.inc");
    include("rpm.inc");
    
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    release = get_kb_item("Host/CentOS/release");
    if (isnull(release) || "CentOS" >!< release) audit(AUDIT_OS_NOT, "CentOS");
    os_ver = pregmatch(pattern: "CentOS(?: Linux)? release ([0-9]+)", string:release);
    if (isnull(os_ver)) audit(AUDIT_UNKNOWN_APP_VER, "CentOS");
    os_ver = os_ver[1];
    if (! preg(pattern:"^7([^0-9]|$)", string:os_ver)) audit(AUDIT_OS_NOT, "CentOS 7.x", "CentOS " + os_ver);
    
    if (!get_kb_item("Host/CentOS/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    
    cpu = get_kb_item("Host/cpu");
    if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);
    if ("x86_64" >!< cpu && cpu !~ "^i[3-6]86$") audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "CentOS", cpu);
    
    
    flag = 0;
    if (rpm_check(release:"CentOS-7", cpu:"x86_64", reference:"postgresql-9.2.21-1.el7")) flag++;
    if (rpm_check(release:"CentOS-7", cpu:"x86_64", reference:"postgresql-contrib-9.2.21-1.el7")) flag++;
    if (rpm_check(release:"CentOS-7", cpu:"x86_64", reference:"postgresql-devel-9.2.21-1.el7")) flag++;
    if (rpm_check(release:"CentOS-7", cpu:"x86_64", reference:"postgresql-docs-9.2.21-1.el7")) flag++;
    if (rpm_check(release:"CentOS-7", cpu:"x86_64", reference:"postgresql-libs-9.2.21-1.el7")) flag++;
    if (rpm_check(release:"CentOS-7", cpu:"x86_64", reference:"postgresql-plperl-9.2.21-1.el7")) flag++;
    if (rpm_check(release:"CentOS-7", cpu:"x86_64", reference:"postgresql-plpython-9.2.21-1.el7")) flag++;
    if (rpm_check(release:"CentOS-7", cpu:"x86_64", reference:"postgresql-pltcl-9.2.21-1.el7")) flag++;
    if (rpm_check(release:"CentOS-7", cpu:"x86_64", reference:"postgresql-server-9.2.21-1.el7")) flag++;
    if (rpm_check(release:"CentOS-7", cpu:"x86_64", reference:"postgresql-static-9.2.21-1.el7")) flag++;
    if (rpm_check(release:"CentOS-7", cpu:"x86_64", reference:"postgresql-test-9.2.21-1.el7")) flag++;
    if (rpm_check(release:"CentOS-7", cpu:"x86_64", reference:"postgresql-upgrade-9.2.21-1.el7")) flag++;
    
    
    if (flag)
    {
      cr_plugin_caveat = '\n' +
        'NOTE: The security advisory associated with this vulnerability has a\n' +
        'fixed package version that may only be available in the continuous\n' +
        'release (CR) repository for CentOS, until it is present in the next\n' +
        'point release of CentOS.\n\n' +
    
        'If an equal or higher package level does not exist in the baseline\n' +
        'repository for your major version of CentOS, then updates from the CR\n' +
        'repository will need to be applied in order to address the\n' +
        'vulnerability.\n';
      security_report_v4(
        port       : 0,
        severity   : SECURITY_WARNING,
        extra      : rpm_report_get() + cr_plugin_caveat
      );
      exit(0);
    }
    else
    {
      tested = pkg_tests_get();
      if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
      else audit(AUDIT_PACKAGE_NOT_INSTALLED, "postgresql / postgresql-contrib / postgresql-devel / etc");
    }
    
  • NASL familyGentoo Local Security Checks
    NASL idGENTOO_GLSA-201710-06.NASL
    descriptionThe remote host is affected by the vulnerability described in GLSA-201710-06 (PostgreSQL: Multiple vulnerabilities) Multiple vulnerabilities have been discovered in PostgreSQL. Please review the referenced CVE identifiers for details. Impact : A remote attacker could escalate privileges, cause a Denial of Service condition, obtain passwords, cause a loss in information, or obtain sensitive information. Workaround : There is no known workaround at this time.
    last seen2020-06-01
    modified2020-06-02
    plugin id103724
    published2017-10-09
    reporterThis script is Copyright (C) 2017-2018 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/103724
    titleGLSA-201710-06 : PostgreSQL: Multiple vulnerabilities
  • NASL familyFreeBSD Local Security Checks
    NASL idFREEBSD_PKG_414C18BF365311E795506CC21735F730.NASL
    descriptionThe PostgreSQL project reports : Security Fixes nested CASE expressions + database and role names with embedded special characters - CVE-2017-7484: selectivity estimators bypass SELECT privilege checks. - CVE-2017-7485: libpq ignores PGREQUIRESSL environment variable - CVE-2017-7486: pg_user_mappings view discloses foreign server passwords. This applies to new databases, see the release notes for the procedure to apply the fix to an existing database.
    last seen2020-06-01
    modified2020-06-02
    plugin id100141
    published2017-05-12
    reporterThis script is Copyright (C) 2017-2018 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/100141
    titleFreeBSD : PostgreSQL vulnerabilities (414c18bf-3653-11e7-9550-6cc21735f730)
  • NASL familyOracle Linux Local Security Checks
    NASL idORACLELINUX_ELSA-2017-1983.NASL
    descriptionFrom Red Hat Security Advisory 2017:1983 : An update for postgresql is now available for Red Hat Enterprise Linux 7. Red Hat Product Security has rated this update as having a security impact of Moderate. A Common Vulnerability Scoring System (CVSS) base score, which gives a detailed severity rating, is available for each vulnerability from the CVE link(s) in the References section. PostgreSQL is an advanced object-relational database management system (DBMS). The following packages have been upgraded to a later upstream version: postgresql (9.2.21). (BZ#1449706) Security Fix(es) : * It was found that some selectivity estimation functions did not check user privileges before providing information from pg_statistic, possibly leaking information. A non-administrative database user could use this flaw to steal some information from tables they are otherwise not allowed to access. (CVE-2017-7484) * It was found that the pg_user_mappings view could disclose information about user mappings to a foreign database to non-administrative database users. A database user with USAGE privilege for this mapping could, when querying the view, obtain user mapping data, such as the username and password used to connect to the foreign database. (CVE-2017-7486) Red Hat would like to thank the PostgreSQL project for reporting these issues. Upstream acknowledges Robert Haas as the original reporter of CVE-2017-7484; and Andrew Wheelwright as the original reporter of CVE-2017-7486. Additional Changes : For detailed information on changes in this release, see the Red Hat Enterprise Linux 7.4 Release Notes linked from the References section.
    last seen2020-06-01
    modified2020-06-02
    plugin id102292
    published2017-08-09
    reporterThis script is Copyright (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/102292
    titleOracle Linux 7 : postgresql (ELSA-2017-1983)
  • NASL familyFedora Local Security Checks
    NASL idFEDORA_2017-0D5817EFC0.NASL
    descriptionFixes CVE-2017-7484 CVE-2017-7485 CVE-2017-7486. Note that Tenable Network Security has extracted the preceding description block directly from the Fedora update system website. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen2020-06-05
    modified2017-07-17
    plugin id101572
    published2017-07-17
    reporterThis script is Copyright (C) 2017-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/101572
    titleFedora 26 : mingw-postgresql (2017-0d5817efc0)
  • NASL familySuSE Local Security Checks
    NASL idSUSE_SU-2017-1783-1.NASL
    descriptionThis update for postgresql93 fixes the following issues : - bsc#1029547: Fix tests with timezone 2017a - CVE-2017-7486: Restrict visibility of pg_user_mappings.umoptions, to protect passwords stored as user mapping options. (bsc#1037624) - CVE-2017-7485: Recognize PGREQUIRESSL variable again. (bsc#1038293) - CVE-2017-7484: Prevent exposure of statistical information via leaky operators. (bsc#1037603) Note that Tenable Network Security has extracted the preceding description block directly from the SUSE security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen2020-06-01
    modified2020-06-02
    plugin id101260
    published2017-07-06
    reporterThis script is Copyright (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/101260
    titleSUSE SLES11 Security Update : postgresql94 (SUSE-SU-2017:1783-1)
  • NASL familyHuawei Local Security Checks
    NASL idEULEROS_SA-2017-1215.NASL
    descriptionAccording to the versions of the posrgresql packages installed, the EulerOS installation on the remote host is affected by the following vulnerabilities : - It was found that some selectivity estimation functions did not check user privileges before providing information from pg_statistic, possibly leaking information. A non-administrative database user could use this flaw to steal some information from tables they are otherwise not allowed to access. (CVE-2017-7484) - It was found that the pg_user_mappings view could disclose information about user mappings to a foreign database to non-administrative database users. A database user with USAGE privilege for this mapping could, when querying the view, obtain user mapping data, such as the username and password used to connect to the foreign database. (CVE-2017-7486) Note that Tenable Network Security has extracted the preceding description block directly from the EulerOS security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen2020-05-06
    modified2017-09-11
    plugin id103073
    published2017-09-11
    reporterThis script is Copyright (C) 2017-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/103073
    titleEulerOS 2.0 SP1 : posrgresql (EulerOS-SA-2017-1215)

Redhat

advisories
  • bugzilla
    id1448089
    titleCVE-2017-7486 postgresql: pg_user_mappings view discloses foreign server passwords
    oval
    OR
    • commentRed Hat Enterprise Linux must be installed
      ovaloval:com.redhat.rhba:tst:20070304026
    • AND
      • commentRed Hat Enterprise Linux 7 is installed
        ovaloval:com.redhat.rhba:tst:20150364027
      • OR
        • AND
          • commentpostgresql-devel is earlier than 0:9.2.21-1.el7
            ovaloval:com.redhat.rhsa:tst:20171983001
          • commentpostgresql-devel is signed with Red Hat redhatrelease2 key
            ovaloval:com.redhat.rhsa:tst:20100908016
        • AND
          • commentpostgresql-plperl is earlier than 0:9.2.21-1.el7
            ovaloval:com.redhat.rhsa:tst:20171983003
          • commentpostgresql-plperl is signed with Red Hat redhatrelease2 key
            ovaloval:com.redhat.rhsa:tst:20100908012
        • AND
          • commentpostgresql-docs is earlier than 0:9.2.21-1.el7
            ovaloval:com.redhat.rhsa:tst:20171983005
          • commentpostgresql-docs is signed with Red Hat redhatrelease2 key
            ovaloval:com.redhat.rhsa:tst:20100908010
        • AND
          • commentpostgresql-plpython is earlier than 0:9.2.21-1.el7
            ovaloval:com.redhat.rhsa:tst:20171983007
          • commentpostgresql-plpython is signed with Red Hat redhatrelease2 key
            ovaloval:com.redhat.rhsa:tst:20100908018
        • AND
          • commentpostgresql-test is earlier than 0:9.2.21-1.el7
            ovaloval:com.redhat.rhsa:tst:20171983009
          • commentpostgresql-test is signed with Red Hat redhatrelease2 key
            ovaloval:com.redhat.rhsa:tst:20100908006
        • AND
          • commentpostgresql is earlier than 0:9.2.21-1.el7
            ovaloval:com.redhat.rhsa:tst:20171983011
          • commentpostgresql is signed with Red Hat redhatrelease2 key
            ovaloval:com.redhat.rhsa:tst:20100908002
        • AND
          • commentpostgresql-contrib is earlier than 0:9.2.21-1.el7
            ovaloval:com.redhat.rhsa:tst:20171983013
          • commentpostgresql-contrib is signed with Red Hat redhatrelease2 key
            ovaloval:com.redhat.rhsa:tst:20100908008
        • AND
          • commentpostgresql-server is earlier than 0:9.2.21-1.el7
            ovaloval:com.redhat.rhsa:tst:20171983015
          • commentpostgresql-server is signed with Red Hat redhatrelease2 key
            ovaloval:com.redhat.rhsa:tst:20100908020
        • AND
          • commentpostgresql-static is earlier than 0:9.2.21-1.el7
            ovaloval:com.redhat.rhsa:tst:20171983017
          • commentpostgresql-static is signed with Red Hat redhatrelease2 key
            ovaloval:com.redhat.rhsa:tst:20171983018
        • AND
          • commentpostgresql-upgrade is earlier than 0:9.2.21-1.el7
            ovaloval:com.redhat.rhsa:tst:20171983019
          • commentpostgresql-upgrade is signed with Red Hat redhatrelease2 key
            ovaloval:com.redhat.rhsa:tst:20150750030
        • AND
          • commentpostgresql-pltcl is earlier than 0:9.2.21-1.el7
            ovaloval:com.redhat.rhsa:tst:20171983021
          • commentpostgresql-pltcl is signed with Red Hat redhatrelease2 key
            ovaloval:com.redhat.rhsa:tst:20100908004
        • AND
          • commentpostgresql-libs is earlier than 0:9.2.21-1.el7
            ovaloval:com.redhat.rhsa:tst:20171983023
          • commentpostgresql-libs is signed with Red Hat redhatrelease2 key
            ovaloval:com.redhat.rhsa:tst:20100908014
    rhsa
    idRHSA-2017:1983
    released2017-08-01
    severityModerate
    titleRHSA-2017:1983: postgresql security and enhancement update (Moderate)
  • rhsa
    idRHSA-2017:1677
  • rhsa
    idRHSA-2017:1678
  • rhsa
    idRHSA-2017:1838
  • rhsa
    idRHSA-2017:2425
rpms
  • rh-postgresql95-postgresql-0:9.5.7-2.el6
  • rh-postgresql95-postgresql-0:9.5.7-2.el7
  • rh-postgresql95-postgresql-contrib-0:9.5.7-2.el6
  • rh-postgresql95-postgresql-contrib-0:9.5.7-2.el7
  • rh-postgresql95-postgresql-debuginfo-0:9.5.7-2.el6
  • rh-postgresql95-postgresql-debuginfo-0:9.5.7-2.el7
  • rh-postgresql95-postgresql-devel-0:9.5.7-2.el6
  • rh-postgresql95-postgresql-devel-0:9.5.7-2.el7
  • rh-postgresql95-postgresql-docs-0:9.5.7-2.el6
  • rh-postgresql95-postgresql-docs-0:9.5.7-2.el7
  • rh-postgresql95-postgresql-libs-0:9.5.7-2.el6
  • rh-postgresql95-postgresql-libs-0:9.5.7-2.el7
  • rh-postgresql95-postgresql-plperl-0:9.5.7-2.el6
  • rh-postgresql95-postgresql-plperl-0:9.5.7-2.el7
  • rh-postgresql95-postgresql-plpython-0:9.5.7-2.el6
  • rh-postgresql95-postgresql-plpython-0:9.5.7-2.el7
  • rh-postgresql95-postgresql-pltcl-0:9.5.7-2.el6
  • rh-postgresql95-postgresql-pltcl-0:9.5.7-2.el7
  • rh-postgresql95-postgresql-server-0:9.5.7-2.el6
  • rh-postgresql95-postgresql-server-0:9.5.7-2.el7
  • rh-postgresql95-postgresql-static-0:9.5.7-2.el6
  • rh-postgresql95-postgresql-static-0:9.5.7-2.el7
  • rh-postgresql95-postgresql-test-0:9.5.7-2.el6
  • rh-postgresql95-postgresql-test-0:9.5.7-2.el7
  • rh-postgresql94-postgresql-0:9.4.12-1.el6
  • rh-postgresql94-postgresql-0:9.4.12-1.el7
  • rh-postgresql94-postgresql-contrib-0:9.4.12-1.el6
  • rh-postgresql94-postgresql-contrib-0:9.4.12-1.el7
  • rh-postgresql94-postgresql-debuginfo-0:9.4.12-1.el6
  • rh-postgresql94-postgresql-debuginfo-0:9.4.12-1.el7
  • rh-postgresql94-postgresql-devel-0:9.4.12-1.el6
  • rh-postgresql94-postgresql-devel-0:9.4.12-1.el7
  • rh-postgresql94-postgresql-docs-0:9.4.12-1.el6
  • rh-postgresql94-postgresql-docs-0:9.4.12-1.el7
  • rh-postgresql94-postgresql-libs-0:9.4.12-1.el6
  • rh-postgresql94-postgresql-libs-0:9.4.12-1.el7
  • rh-postgresql94-postgresql-plperl-0:9.4.12-1.el6
  • rh-postgresql94-postgresql-plperl-0:9.4.12-1.el7
  • rh-postgresql94-postgresql-plpython-0:9.4.12-1.el6
  • rh-postgresql94-postgresql-plpython-0:9.4.12-1.el7
  • rh-postgresql94-postgresql-pltcl-0:9.4.12-1.el6
  • rh-postgresql94-postgresql-pltcl-0:9.4.12-1.el7
  • rh-postgresql94-postgresql-server-0:9.4.12-1.el6
  • rh-postgresql94-postgresql-server-0:9.4.12-1.el7
  • rh-postgresql94-postgresql-static-0:9.4.12-1.el6
  • rh-postgresql94-postgresql-static-0:9.4.12-1.el7
  • rh-postgresql94-postgresql-test-0:9.4.12-1.el6
  • rh-postgresql94-postgresql-test-0:9.4.12-1.el7
  • rh-postgresql94-postgresql-upgrade-0:9.4.12-1.el6
  • rh-postgresql94-postgresql-upgrade-0:9.4.12-1.el7
  • rh-postgresql95-postgresql-0:9.5.7-2.el6
  • rh-postgresql95-postgresql-contrib-0:9.5.7-2.el6
  • rh-postgresql95-postgresql-debuginfo-0:9.5.7-2.el6
  • rh-postgresql95-postgresql-libs-0:9.5.7-2.el6
  • rh-postgresql95-postgresql-pltcl-0:9.5.7-2.el6
  • rh-postgresql95-postgresql-server-0:9.5.7-2.el6
  • postgresql-0:9.2.21-1.el7
  • postgresql-contrib-0:9.2.21-1.el7
  • postgresql-debuginfo-0:9.2.21-1.el7
  • postgresql-devel-0:9.2.21-1.el7
  • postgresql-docs-0:9.2.21-1.el7
  • postgresql-libs-0:9.2.21-1.el7
  • postgresql-plperl-0:9.2.21-1.el7
  • postgresql-plpython-0:9.2.21-1.el7
  • postgresql-pltcl-0:9.2.21-1.el7
  • postgresql-server-0:9.2.21-1.el7
  • postgresql-static-0:9.2.21-1.el7
  • postgresql-test-0:9.2.21-1.el7
  • postgresql-upgrade-0:9.2.21-1.el7
  • rh-postgresql95-postgresql-0:9.5.7-2.el6
  • rh-postgresql95-postgresql-contrib-0:9.5.7-2.el6
  • rh-postgresql95-postgresql-debuginfo-0:9.5.7-2.el6
  • rh-postgresql95-postgresql-libs-0:9.5.7-2.el6
  • rh-postgresql95-postgresql-pltcl-0:9.5.7-2.el6
  • rh-postgresql95-postgresql-server-0:9.5.7-2.el6
  • rh-postgresql95-runtime-0:2.2-3.el6
  • spacewalk-backend-0:2.3.3-53.el6sat
  • spacewalk-backend-app-0:2.3.3-53.el6sat
  • spacewalk-backend-applet-0:2.3.3-53.el6sat
  • spacewalk-backend-config-files-0:2.3.3-53.el6sat
  • spacewalk-backend-config-files-common-0:2.3.3-53.el6sat
  • spacewalk-backend-config-files-tool-0:2.3.3-53.el6sat
  • spacewalk-backend-iss-0:2.3.3-53.el6sat
  • spacewalk-backend-iss-export-0:2.3.3-53.el6sat
  • spacewalk-backend-libs-0:2.3.3-53.el6sat
  • spacewalk-backend-package-push-server-0:2.3.3-53.el6sat
  • spacewalk-backend-server-0:2.3.3-53.el6sat
  • spacewalk-backend-sql-0:2.3.3-53.el6sat
  • spacewalk-backend-sql-oracle-0:2.3.3-53.el6sat
  • spacewalk-backend-sql-postgresql-0:2.3.3-53.el6sat
  • spacewalk-backend-tools-0:2.3.3-53.el6sat
  • spacewalk-backend-xml-export-libs-0:2.3.3-53.el6sat
  • spacewalk-backend-xmlrpc-0:2.3.3-53.el6sat
  • spacewalk-base-0:2.3.2-35.el6sat
  • spacewalk-base-minimal-0:2.3.2-35.el6sat
  • spacewalk-base-minimal-config-0:2.3.2-35.el6sat
  • spacewalk-dobby-0:2.3.2-35.el6sat
  • spacewalk-grail-0:2.3.2-35.el6sat
  • spacewalk-html-0:2.3.2-35.el6sat
  • spacewalk-postgresql-server-0:9.5-1.el6sat
  • spacewalk-pxt-0:2.3.2-35.el6sat
  • spacewalk-setup-postgresql-0:2.3.0-27.el6sat
  • spacewalk-sniglets-0:2.3.2-35.el6sat
  • spacewalk-utils-0:2.3.2-32.el6sat