Vulnerabilities > CVE-2005-0247 - Improper Restriction of Operations Within the Bounds of A Memory Buffer vulnerability in Postgresql

047910
CVSS 6.5 - MEDIUM
Attack vector
NETWORK
Attack complexity
LOW
Privileges required
SINGLE
Confidentiality impact
PARTIAL
Integrity impact
PARTIAL
Availability impact
PARTIAL
network
low complexity
postgresql
CWE-119
nessus

Summary

Multiple buffer overflows in gram.y for PostgreSQL 8.0.1 and earlier may allow attackers to execute arbitrary code via (1) a large number of variables in a SQL statement being handled by the read_sql_construct function, (2) a large number of INTO variables in a SELECT statement being handled by the make_select_stmt function, (3) a large number of arbitrary variables in a SELECT statement being handled by the make_select_stmt function, and (4) a large number of INTO variables in a FETCH statement being handled by the make_fetch_stmt function, a different set of vulnerabilities than CVE-2005-0245.

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Buffer Overflow via Environment Variables
    This attack pattern involves causing a buffer overflow through manipulation of environment variables. Once the attacker finds that they can modify an environment variable, they may try to overflow associated buffers. This attack leverages implicit trust often placed in environment variables.
  • Overflow Buffers
    Buffer Overflow attacks target improper or missing bounds checking on buffer operations, typically triggered by input injected by an attacker. As a consequence, an attacker is able to write past the boundaries of allocated buffer regions in memory, causing a program crash or potentially redirection of execution as per the attackers' choice.
  • Client-side Injection-induced Buffer Overflow
    This type of attack exploits a buffer overflow vulnerability in targeted client software through injection of malicious content from a custom-built hostile service.
  • Filter Failure through Buffer Overflow
    In this attack, the idea is to cause an active filter to fail by causing an oversized transaction. An attacker may try to feed overly long input strings to the program in an attempt to overwhelm the filter (by causing a buffer overflow) and hoping that the filter does not fail securely (i.e. the user input is let into the system unfiltered).
  • MIME Conversion
    An attacker exploits a weakness in the MIME conversion routine to cause a buffer overflow and gain control over the mail server machine. The MIME system is designed to allow various different information formats to be interpreted and sent via e-mail. Attack points exist when data are converted to MIME compatible format and back.

Nessus

  • NASL familyRed Hat Local Security Checks
    NASL idREDHAT-RHSA-2005-138.NASL
    descriptionUpdated postresql packages that correct various security issues are now available for Red Hat Enterprise Linux 4. This update has been rated as having important security impact by the Red Hat Security Response Team. A flaw in the LOAD command in PostgreSQL was discovered. A local user could use this flaw to load arbitrary shared libraries and therefore execute arbitrary code, gaining the privileges of the PostgreSQL server. The Common Vulnerabilities and Exposures project (cve.mitre.org) has assigned the name CVE-2005-0227 to this issue. A permission checking flaw in PostgreSQL was discovered. A local user could bypass the EXECUTE permission check for functions by using the CREATE AGGREGATE command. The Common Vulnerabilities and Exposures project (cve.mitre.org) has assigned the name CVE-2005-0244 to this issue. Multiple buffer overflows were found in PL/PgSQL. A database user who has permissions to create plpgsql functions could trigger this flaw which could lead to arbitrary code execution, gaining the privileges of the PostgreSQL server. The Common Vulnerabilities and Exposures project (cve.mitre.org) has assigned the names CVE-2005-0245 and CVE-2005-0247 to these issues. A flaw in the integer aggregator (intagg) contrib module for PostgreSQL was found. A user could create carefully crafted arrays and cause a denial of service (crash). The Common Vulnerabilities and Exposures project (cve.mitre.org) has assigned the name CVE-2005-0246 to this issue. The update also fixes some minor problems, notably conflicts with SELinux. Users of postgresql should update to these erratum packages that contain patches and are not vulnerable to these issues.
    last seen2020-06-01
    modified2020-06-02
    plugin id17192
    published2005-02-22
    reporterThis script is Copyright (C) 2005-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/17192
    titleRHEL 4 : postgresql (RHSA-2005:138)
  • NASL familyGentoo Local Security Checks
    NASL idGENTOO_GLSA-200502-19.NASL
    descriptionThe remote host is affected by the vulnerability described in GLSA-200502-19 (PostgreSQL: Buffer overflows in PL/PgSQL parser) PostgreSQL is vulnerable to several buffer overflows in the PL/PgSQL parser. Impact : A remote attacker could send a malicious query resulting in the execution of arbitrary code with the permissions of the user running PostgreSQL. Workaround : There is no known workaround at this time.
    last seen2020-06-01
    modified2020-06-02
    plugin id16460
    published2005-02-15
    reporterThis script is Copyright (C) 2005-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/16460
    titleGLSA-200502-19 : PostgreSQL: Buffer overflows in PL/PgSQL parser
  • NASL familyFreeBSD Local Security Checks
    NASL idFREEBSD_PKG_6B4B0B3F812711D9A9E70001020EED82.NASL
    descriptionThe PL/PgSQL parser in postgresql is vulnerable to several buffer overflows. These could be exploited by a remote attacker to execute arbitrary code with the permissions of the postgresql server by running a specially crafted query.
    last seen2020-06-01
    modified2020-06-02
    plugin id18973
    published2005-07-13
    reporterThis script is Copyright (C) 2005-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/18973
    titleFreeBSD : postgresql -- multiple buffer overflows in PL/PgSQL parser (6b4b0b3f-8127-11d9-a9e7-0001020eed82)
  • NASL familyDatabases
    NASL idPOSTGRESQL_MULTIPLE_FLAWS2.NASL
    descriptionThe remote PostgreSQL server, according to its version number, is vulnerable to multiple flaws that could allow an attacker who has the rights to query the remote database to obtain a shell on this host.
    last seen2020-06-01
    modified2020-06-02
    plugin id16309
    published2005-02-03
    reporterThis script is Copyright (C) 2005-2018 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/16309
    titlePostgreSQL < 7.2.7 / 7.3.9 / 7.4.7 / 8.0.1 Multiple Vulnerabilities
  • NASL familyRed Hat Local Security Checks
    NASL idREDHAT-RHSA-2005-141.NASL
    descriptionUpdated PostgreSQL packages to fix various security flaws are now available for Red Hat Enterprise Linux 3. PostgreSQL is an advanced Object-Relational database management system (DBMS). A flaw in the LOAD command in PostgreSQL was discovered. A local user could use this flaw to load arbitrary shared librarys and therefore execute arbitrary code, gaining the privileges of the PostgreSQL server. The Common Vulnerabilities and Exposures project (cve.mitre.org) has assigned the name CVE-2005-0227 to this issue. A permission checking flaw in PostgreSQL was discovered. A local user could bypass the EXECUTE permission check for functions by using the CREATE AGGREGATE command. The Common Vulnerabilities and Exposures project (cve.mitre.org) has assigned the name CVE-2005-0244 to this issue. Multiple buffer overflows were found in PL/PgSQL. A database user who has permissions to create plpgsql functions could trigger this flaw which could lead to arbitrary code execution, gaining the privileges of the PostgreSQL server. The Common Vulnerabilities and Exposures project (cve.mitre.org) has assigned the names CVE-2005-0245 and CVE-2005-0247 to these issues. A flaw in the integer aggregator (intagg) contrib module for PostgreSQL was found. A user could create carefully crafted arrays and cause a denial of service (crash). The Common Vulnerabilities and Exposures project (cve.mitre.org) has assigned the name CVE-2005-0246 to this issue. Users of PostgreSQL are advised to update to these erratum packages which are not vulnerable to these issues.
    last seen2020-06-01
    modified2020-06-02
    plugin id16386
    published2005-02-14
    reporterThis script is Copyright (C) 2005-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/16386
    titleRHEL 3 : rh-postgresql (RHSA-2005:141)
  • NASL familyFedora Local Security Checks
    NASL idFEDORA_2005-157.NASL
    description - Mon Feb 21 2005 Tom Lane <tgl at redhat.com> 7.4.7-3.FC3.1 - Work around selinux <<EOF problem during initdb (bug #149237). - Repair improper error message in init script when PGVERSION doesn
    last seen2020-06-01
    modified2020-06-02
    plugin id19616
    published2005-09-12
    reporterThis script is Copyright (C) 2005-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/19616
    titleFedora Core 3 : postgresql-7.4.7-3.FC3.1 (2005-157)
  • NASL familyFedora Local Security Checks
    NASL idFEDORA_2005-158.NASL
    description - Mon Feb 21 2005 Tom Lane <tgl at redhat.com> 7.4.7-3.FC2.1 - Repair improper error message in init script when PGVERSION doesn
    last seen2020-06-01
    modified2020-06-02
    plugin id19617
    published2005-09-12
    reporterThis script is Copyright (C) 2005-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/19617
    titleFedora Core 2 : postgresql-7.4.7-3.FC2.1 (2005-158)
  • NASL familyMandriva Local Security Checks
    NASL idMANDRAKE_MDKSA-2005-040.NASL
    descriptionA number of vulnerabilities were found and corrected in the PostgreSQL DBMS : A flaw in the LOAD command could be abused by a local user to load arbitrary shared libraries and as a result execute arbitrary code with the privileges of the user running the postgresql server (CVE-2005-0227). A permission checking flaw was found where a local user could bypass the EXECUTE permission check for functions using the CREATE AGGREGATE command (CVE-2005-0244). Multiple buffer overflows were discovered in PL/PgSQL. A database user with permission to create plpgsql functions could trigger these flaws which could then lead to arbitrary code execution with the privileges of the user running the postgresql server (CVE-2005-0245 and CVE-2005-0247). Finally, a flaw in the integer aggregator (intagg) contrib module was found. A user could create carefully crafted arrays and crash the server, causing a Denial of Service (CVE-2005-0246). The updated packages have been patched to correct these problems.
    last seen2020-06-01
    modified2020-06-02
    plugin id17139
    published2005-02-18
    reporterThis script is Copyright (C) 2005-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/17139
    titleMandrake Linux Security Advisory : postgresql (MDKSA-2005:040)
  • NASL familyDebian Local Security Checks
    NASL idDEBIAN_DSA-683.NASL
    descriptionSeveral buffer overflows have been discovered in PL/PgSQL as part of the PostgreSQL engine which could lead to the execution of arbitrary code.
    last seen2020-06-01
    modified2020-06-02
    plugin id16465
    published2005-02-16
    reporterThis script is Copyright (C) 2005-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/16465
    titleDebian DSA-683-1 : postgresql - buffer overflows
  • NASL familyRed Hat Local Security Checks
    NASL idREDHAT-RHSA-2005-150.NASL
    descriptionUpdated PostgreSQL packages to fix various security flaws are now available for Red Hat Enterprise Linux 2.1AS. This update has been rated as having important security impact by the Red Hat Security Response Team. PostgreSQL is an advanced Object-Relational database management system (DBMS). A flaw in the LOAD command in PostgreSQL was discovered. A local user could use this flaw to load arbitrary shared libraries and therefore execute arbitrary code, gaining the privileges of the PostgreSQL server. The Common Vulnerabilities and Exposures project (cve.mitre.org) has assigned the name CVE-2005-0227 to this issue. Multiple buffer overflows were found in PL/PgSQL. A database user who has permissions to create plpgsql functions could trigger this flaw which could lead to arbitrary code execution, gaining the privileges of the PostgreSQL server. The Common Vulnerabilities and Exposures project (cve.mitre.org) has assigned the names CVE-2005-0245 and CVE-2005-0247 to these issues. Users of PostgreSQL are advised to update to these erratum packages which are not vulnerable to these issues.
    last seen2020-06-01
    modified2020-06-02
    plugin id17129
    published2005-02-16
    reporterThis script is Copyright (C) 2005-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/17129
    titleRHEL 2.1 : postgresql (RHSA-2005:150)
  • NASL familySuSE Local Security Checks
    NASL idSUSE_SA_2005_027.NASL
    descriptionThe remote host is missing the patch for the advisory SUSE-SA:2005:027 (postgresql). Several problems were identified and fixed in the PostgreSQL database server. Multiple buffer overflows in the low level parsing routines may allow attackers to execute arbitrary code via: (1) a large number of variables in a SQL statement being handled by the read_sql_construct() function, (2) a large number of INTO variables in a SELECT statement being handled by the make_select_stmt function, (3) a large number of arbitrary variables in a SELECT statement being handled by the make_select_stmt function, and (4) a large number of INTO variables in a FETCH statement being handled by the make_fetch_stmt function. This is tracked by the Mitre CVE ID CVE-2005-0247.
    last seen2020-06-01
    modified2020-06-02
    plugin id18113
    published2005-04-21
    reporterThis script is Copyright (C) 2005-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/18113
    titleSUSE-SA:2005:027: postgresql
  • NASL familyUbuntu Local Security Checks
    NASL idUBUNTU_USN-79-1.NASL
    descriptionThe execution of custom PostgreSQL functions can be restricted with the EXECUTE privilege. However, previous versions did not check this privilege when executing a function which was part of an aggregate. As a result, any database user could circumvent the EXECUTE restriction of functions with a particular (but very common) parameter structure by creating an aggregate wrapper around the function. (CAN-2005-0244) Several buffer overflows have been discovered in the SQL parser. These could be exploited by any database user to crash the PostgreSQL server or execute arbitrary code with the privileges of the server. (CAN-2005-0245, CAN-2005-0247) Finally, this update fixes a Denial of Service vulnerability of the contributed
    last seen2020-06-01
    modified2020-06-02
    plugin id20702
    published2006-01-15
    reporterUbuntu Security Notice (C) 2005-2019 Canonical, Inc. / NASL script (C) 2006-2016 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/20702
    titleUbuntu 4.10 : postgresql vulnerabilities (USN-79-1)

Oval

accepted2013-04-29T04:18:53.747-04:00
classvulnerability
contributors
  • nameAharon Chernin
    organizationSCAP.com, LLC
  • nameDragos Prisaca
    organizationG2, Inc.
definition_extensions
  • commentThe operating system installed on the system is Red Hat Enterprise Linux 3
    ovaloval:org.mitre.oval:def:11782
  • commentCentOS Linux 3.x
    ovaloval:org.mitre.oval:def:16651
  • commentThe operating system installed on the system is Red Hat Enterprise Linux 4
    ovaloval:org.mitre.oval:def:11831
  • commentCentOS Linux 4.x
    ovaloval:org.mitre.oval:def:16636
  • commentOracle Linux 4.x
    ovaloval:org.mitre.oval:def:15990
descriptionMultiple buffer overflows in gram.y for PostgreSQL 8.0.1 and earlier may allow attackers to execute arbitrary code via (1) a large number of variables in a SQL statement being handled by the read_sql_construct function, (2) a large number of INTO variables in a SELECT statement being handled by the make_select_stmt function, (3) a large number of arbitrary variables in a SELECT statement being handled by the make_select_stmt function, and (4) a large number of INTO variables in a FETCH statement being handled by the make_fetch_stmt function, a different set of vulnerabilities than CVE-2005-0245.
familyunix
idoval:org.mitre.oval:def:9345
statusaccepted
submitted2010-07-09T03:56:16-04:00
titleBuffer overflow in gram.y for PostgreSQL 8.0.0 and earlier may allow attackers to execute arbitrary code via a large number of arguments to a refcursor function (gram.y), which leads to a heap-based buffer overflow, a different vulnerability than CVE-2005-0247.
version26

Redhat

advisories
  • rhsa
    idRHSA-2005:138
  • rhsa
    idRHSA-2005:150
rpms
  • postgresql-0:7.4.7-2.RHEL4.1
  • postgresql-contrib-0:7.4.7-2.RHEL4.1
  • postgresql-debuginfo-0:7.4.7-2.RHEL4.1
  • postgresql-devel-0:7.4.7-2.RHEL4.1
  • postgresql-docs-0:7.4.7-2.RHEL4.1
  • postgresql-jdbc-0:7.4.7-2.RHEL4.1
  • postgresql-libs-0:7.4.7-2.RHEL4.1
  • postgresql-pl-0:7.4.7-2.RHEL4.1
  • postgresql-python-0:7.4.7-2.RHEL4.1
  • postgresql-server-0:7.4.7-2.RHEL4.1
  • postgresql-tcl-0:7.4.7-2.RHEL4.1
  • postgresql-test-0:7.4.7-2.RHEL4.1
  • rh-postgresql-0:7.3.9-2
  • rh-postgresql-contrib-0:7.3.9-2
  • rh-postgresql-debuginfo-0:7.3.9-2
  • rh-postgresql-devel-0:7.3.9-2
  • rh-postgresql-docs-0:7.3.9-2
  • rh-postgresql-jdbc-0:7.3.9-2
  • rh-postgresql-libs-0:7.3.9-2
  • rh-postgresql-pl-0:7.3.9-2
  • rh-postgresql-python-0:7.3.9-2
  • rh-postgresql-server-0:7.3.9-2
  • rh-postgresql-tcl-0:7.3.9-2
  • rh-postgresql-test-0:7.3.9-2