Vulnerabilities > CVE-2007-2138 - Permissions, Privileges, and Access Controls vulnerability in multiple products
Attack vector
NETWORK Attack complexity
MEDIUM Privileges required
SINGLE Confidentiality impact
PARTIAL Integrity impact
PARTIAL Availability impact
PARTIAL Summary
Untrusted search path vulnerability in PostgreSQL before 7.3.19, 7.4.x before 7.4.17, 8.0.x before 8.0.13, 8.1.x before 8.1.9, and 8.2.x before 8.2.4 allows remote authenticated users, when permitted to call a SECURITY DEFINER function, to gain the privileges of the function owner, related to "search_path settings."
Vulnerable Configurations
Common Weakness Enumeration (CWE)
Common Attack Pattern Enumeration and Classification (CAPEC)
- Accessing, Modifying or Executing Executable Files An attack of this type exploits a system's configuration that allows an attacker to either directly access an executable file, for example through shell access; or in a possible worst case allows an attacker to upload a file and then execute it. Web servers, ftp servers, and message oriented middleware systems which have many integration points are particularly vulnerable, because both the programmers and the administrators must be in synch regarding the interfaces and the correct privileges for each interface.
- Leverage Executable Code in Non-Executable Files An attack of this type exploits a system's trust in configuration and resource files, when the executable loads the resource (such as an image file or configuration file) the attacker has modified the file to either execute malicious code directly or manipulate the target process (e.g. application server) to execute based on the malicious configuration parameters. Since systems are increasingly interrelated mashing up resources from local and remote sources the possibility of this attack occurring is high. The attack can be directed at a client system, such as causing buffer overrun through loading seemingly benign image files, as in Microsoft Security Bulletin MS04-028 where specially crafted JPEG files could cause a buffer overrun once loaded into the browser. Another example targets clients reading pdf files. In this case the attacker simply appends javascript to the end of a legitimate url for a pdf (http://www.gnucitizen.org/blog/danger-danger-danger/) http://path/to/pdf/file.pdf#whatever_name_you_want=javascript:your_code_here The client assumes that they are reading a pdf, but the attacker has modified the resource and loaded executable javascript into the client's browser process. The attack can also target server processes. The attacker edits the resource or configuration file, for example a web.xml file used to configure security permissions for a J2EE app server, adding role name "public" grants all users with the public role the ability to use the administration functionality. The server trusts its configuration file to be correct, but when they are manipulated, the attacker gains full control.
- Blue Boxing This type of attack against older telephone switches and trunks has been around for decades. A tone is sent by an adversary to impersonate a supervisor signal which has the effect of rerouting or usurping command of the line. While the US infrastructure proper may not contain widespread vulnerabilities to this type of attack, many companies are connected globally through call centers and business process outsourcing. These international systems may be operated in countries which have not upgraded Telco infrastructure and so are vulnerable to Blue boxing. Blue boxing is a result of failure on the part of the system to enforce strong authorization for administrative functions. While the infrastructure is different than standard current applications like web applications, there are historical lessons to be learned to upgrade the access control for administrative functions.
- Restful Privilege Elevation Rest uses standard HTTP (Get, Put, Delete) style permissions methods, but these are not necessarily correlated generally with back end programs. Strict interpretation of HTTP get methods means that these HTTP Get services should not be used to delete information on the server, but there is no access control mechanism to back up this logic. This means that unless the services are properly ACL'd and the application's service implementation are following these guidelines then an HTTP request can easily execute a delete or update on the server side. The attacker identifies a HTTP Get URL such as http://victimsite/updateOrder, which calls out to a program to update orders on a database or other resource. The URL is not idempotent so the request can be submitted multiple times by the attacker, additionally, the attacker may be able to exploit the URL published as a Get method that actually performs updates (instead of merely retrieving data). This may result in malicious or inadvertent altering of data on the server.
- Target Programs with Elevated Privileges This attack targets programs running with elevated privileges. The attacker would try to leverage a bug in the running program and get arbitrary code to execute with elevated privileges. For instance an attacker would look for programs that write to the system directories or registry keys (such as HKLM, which stores a number of critical Windows environment variables). These programs are typically running with elevated privileges and have usually not been designed with security in mind. Such programs are excellent exploit targets because they yield lots of power when they break. The malicious user try to execute its code at the same level as a privileged system call.
Nessus
NASL family Solaris Local Security Checks NASL id SOLARIS10_X86_123591.NASL description SunOS 5.10_x86: PostgreSQL patch. Date this patch was last updated by Sun : Jan/14/10 This plugin has been deprecated and either replaced with individual 123591 patch-revision plugins, or deemed non-security related. last seen 2019-02-21 modified 2018-07-30 plugin id 24849 published 2007-03-18 reporter Tenable source https://www.tenable.com/plugins/index.php?view=single&id=24849 title Solaris 10 (x86) : 123591-12 (deprecated) NASL family Gentoo Local Security Checks NASL id GENTOO_GLSA-200705-12.NASL description The remote host is affected by the vulnerability described in GLSA-200705-12 (PostgreSQL: Privilege escalation) An error involving insecure search_path settings in the SECURITY DEFINER functions has been reported in PostgreSQL. Impact : If allowed to call a SECURITY DEFINER function, an attacker could gain the SQL privileges of the owner of the called function. Workaround : There is no known workaround at this time. last seen 2020-06-01 modified 2020-06-02 plugin id 25208 published 2007-05-11 reporter This script is Copyright (C) 2007-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/25208 title GLSA-200705-12 : PostgreSQL: Privilege escalation NASL family Fedora Local Security Checks NASL id FEDORA_2007-565.NASL description Update to PostgreSQL 8.1.9 for CVE-2007-2138, data loss bugs Note that Tenable Network Security has extracted the preceding description block directly from the Fedora security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues. last seen 2020-06-01 modified 2020-06-02 plugin id 25449 published 2007-06-07 reporter This script is Copyright (C) 2007-2019 Tenable Network Security, Inc. source https://www.tenable.com/plugins/nessus/25449 title Fedora Core 6 : postgresql-8.1.9-1.fc6 (2007-565) NASL family Solaris Local Security Checks NASL id SOLARIS10_123590-12.NASL description SunOS 5.10: PostgreSQL patch. Date this patch was last updated by Sun : Jan/14/10 last seen 2020-06-01 modified 2020-06-02 plugin id 107391 published 2018-03-12 reporter This script is Copyright (C) 2018-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/107391 title Solaris 10 (sparc) : 123590-12 NASL family Mandriva Local Security Checks NASL id MANDRAKE_MDKSA-2007-094.NASL description A weakness in previous versions of PostgreSQL was found in the security definer functions in which an authenticated but otherwise unprivileged SQL user could use temporary objects to execute arbitrary code with the privileges of the security-definer function. IMPORTANT NOTICE FOR CORPORATE SERVER/DESKTOP 3.0 USERS : In addition, packages for Corporate Server/Desktop 3.0 have been updated to the latest PostgreSQL 7.4.17 which requires some attention when upgrading. To take advantage of the new version, and to ensure data coherency, we strongly recommend dumping the old databases, re-initializing the database, and then reloading the dumped data. This can be accomplished as root using : # service postgresql start # su - postgres $ pg_dumpall >/tmp/database.dump $ exit # service postgresql stop # mv /var/lib/pgsql /var/lib/pgsql.bk # urpmi.update -a && urpmi --auto-select # service postgresql start # service postgresql restart # su - postgres $ /usr/bin/psql -d template1 -f /tmp/database.dump $ exit Only Corporate Server/Desktop 3.0 requires the dump/reload steps; the other Mandriva Linux platforms do not require this step. Notice that the double-restart of the postgresql service is in fact required. Updated packages have been patched to correct this issue. last seen 2020-06-01 modified 2020-06-02 plugin id 25115 published 2007-04-30 reporter This script is Copyright (C) 2007-2019 Tenable Network Security, Inc. source https://www.tenable.com/plugins/nessus/25115 title Mandrake Linux Security Advisory : postgresql (MDKSA-2007:094) NASL family Scientific Linux Local Security Checks NASL id SL_20070508_POSTGRESQL_ON_ON_SL3_0_X.NASL description A flaw was found in the way PostgreSQL allows authenticated users to execute security-definer functions. It was possible for an unprivileged user to execute arbitrary code with the privileges of the security-definer function. (CVE-2007-2138) last seen 2020-06-01 modified 2020-06-02 plugin id 60177 published 2012-08-01 reporter This script is Copyright (C) 2012-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/60177 title Scientific Linux Security Update : postgresql on on SL3.0.x i386/x86_64 NASL family Debian Local Security Checks NASL id DEBIAN_DLA-1874.NASL description - CVE-2019-10208: `TYPE` in `pg_temp` executes arbitrary SQL during `SECURITY DEFINER` execution Versions Affected: 9.4 - 11 Given a suitable `SECURITY DEFINER` function, an attacker can execute arbitrary SQL under the identity of the function owner. An attack requires `EXECUTE` permission on the function, which must itself contain a function call having inexact argument type match. For example, `length( last seen 2020-06-01 modified 2020-06-02 plugin id 127483 published 2019-08-12 reporter This script is Copyright (C) 2019-2020 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/127483 title Debian DLA-1874-1 : postgresql-9.4 security update NASL family Solaris Local Security Checks NASL id SOLARIS10_X86_123591-12.NASL description SunOS 5.10_x86: PostgreSQL patch. Date this patch was last updated by Sun : Jan/14/10 last seen 2020-06-01 modified 2020-06-02 plugin id 107893 published 2018-03-12 reporter This script is Copyright (C) 2018-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/107893 title Solaris 10 (x86) : 123591-12 NASL family Fedora Local Security Checks NASL id FEDORA_2007-566.NASL description Update to PostgreSQL 8.1.9 for CVE-2007-2138, data loss bugs Note that Tenable Network Security has extracted the preceding description block directly from the Fedora security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues. last seen 2020-06-01 modified 2020-06-02 plugin id 25450 published 2007-06-07 reporter This script is Copyright (C) 2007-2019 Tenable Network Security, Inc. source https://www.tenable.com/plugins/nessus/25450 title Fedora Core 5 : postgresql-8.1.9-1.fc5 (2007-566) NASL family Scientific Linux Local Security Checks NASL id SL_20070508_POSTGRESQL_ON_SL4.NASL description Updated postgresql packages that fix several security issues are now available. A flaw was found in the way PostgreSQL allows authenticated users to execute security-definer functions. It was possible for an unprivileged user to execute arbitrary code with the privileges of the security-definer function. (CVE-2007-2138) last seen 2020-06-01 modified 2020-06-02 plugin id 60176 published 2012-08-01 reporter This script is Copyright (C) 2012-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/60176 title Scientific Linux Security Update : postgresql on SL4 i386,x86_64, SL5 i386 NASL family Fedora Local Security Checks NASL id FEDORA_2007-0174.NASL description Update to PostgreSQL 8.2.4 for CVE-2007-2138, data loss bugs Note that Tenable Network Security has extracted the preceding description block directly from the Fedora security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues. last seen 2020-06-01 modified 2020-06-02 plugin id 27652 published 2007-11-06 reporter This script is Copyright (C) 2007-2019 Tenable Network Security, Inc. source https://www.tenable.com/plugins/nessus/27652 title Fedora 7 : postgresql-8.2.4-1.fc7 (2007-0174) NASL family Debian Local Security Checks NASL id DEBIAN_DSA-1311.NASL description It was discovered that the PostgreSQL database performs insufficient validation of variables passed to privileged SQL statement called last seen 2020-06-01 modified 2020-06-02 plugin id 25555 published 2007-06-21 reporter This script is Copyright (C) 2007-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/25555 title Debian DSA-1311-1 : postgresql-7.4 - programming error NASL family FreeBSD Local Security Checks NASL id FREEBSD_PKG_9DE4C1C1B9EE11E982AA6CC21735F730.NASL description The PostgreSQL project reports : Versions Affected: 9.4 - 11 Given a suitable `SECURITY DEFINER` function, an attacker can execute arbitrary SQL under the identity of the function owner. An attack requires `EXECUTE` permission on the function, which must itself contain a function call having inexact argument type match. For example, `length( last seen 2020-06-01 modified 2020-06-02 plugin id 127549 published 2019-08-12 reporter This script is Copyright (C) 2019-2020 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/127549 title FreeBSD : PostgresSQL -- TYPE in pg_temp execute arbitrary SQL during `SECURITY DEFINER` execution (9de4c1c1-b9ee-11e9-82aa-6cc21735f730) NASL family Red Hat Local Security Checks NASL id REDHAT-RHSA-2007-0336.NASL description Updated postgresql packages that fix several security issues are now available for Red Hat Enterprise Linux 3, 4, and 5. This update has been rated as having moderate security impact by the Red Hat Security Response Team. PostgreSQL is an advanced Object-Relational database management system (DBMS). A flaw was found in the way PostgreSQL allows authenticated users to execute security-definer functions. It was possible for an unprivileged user to execute arbitrary code with the privileges of the security-definer function. (CVE-2007-2138) Users of PostgreSQL should upgrade to these updated packages containing PostgreSQL version 8.1.9, 7.4.17, and 7.3.19 which corrects this issue. last seen 2020-06-01 modified 2020-06-02 plugin id 25192 published 2007-05-10 reporter This script is Copyright (C) 2007-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/25192 title RHEL 3 / 4 / 5 : postgresql (RHSA-2007:0336) NASL family CentOS Local Security Checks NASL id CENTOS_RHSA-2007-0336.NASL description Updated postgresql packages that fix several security issues are now available for Red Hat Enterprise Linux 3, 4, and 5. This update has been rated as having moderate security impact by the Red Hat Security Response Team. PostgreSQL is an advanced Object-Relational database management system (DBMS). A flaw was found in the way PostgreSQL allows authenticated users to execute security-definer functions. It was possible for an unprivileged user to execute arbitrary code with the privileges of the security-definer function. (CVE-2007-2138) Users of PostgreSQL should upgrade to these updated packages containing PostgreSQL version 8.1.9, 7.4.17, and 7.3.19 which corrects this issue. last seen 2020-06-01 modified 2020-06-02 plugin id 25175 published 2007-05-10 reporter This script is Copyright (C) 2007-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/25175 title CentOS 3 / 4 / 5 : postgresql (CESA-2007:0336) NASL family Ubuntu Local Security Checks NASL id UBUNTU_USN-454-1.NASL description PostgreSQL did not handle the last seen 2020-06-01 modified 2020-06-02 plugin id 28052 published 2007-11-10 reporter Ubuntu Security Notice (C) 2007-2019 Canonical, Inc. / NASL script (C) 2018 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/28052 title Ubuntu 6.06 LTS / 6.10 / 7.04 : postgresql-8.1, postgresql-8.2 vulnerability (USN-454-1) NASL family Debian Local Security Checks NASL id DEBIAN_DSA-1309.NASL description It was discovered that the PostgreSQL database performs insufficient validation of variables passed to privileged SQL statements, so called last seen 2020-06-01 modified 2020-06-02 plugin id 25531 published 2007-06-18 reporter This script is Copyright (C) 2007-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/25531 title Debian DSA-1309-1 : postgresql-8.1 - programming error NASL family Solaris Local Security Checks NASL id SOLARIS10_123590.NASL description SunOS 5.10: PostgreSQL patch. Date this patch was last updated by Sun : Jan/14/10 This plugin has been deprecated and either replaced with individual 123590 patch-revision plugins, or deemed non-security related. last seen 2019-02-21 modified 2018-07-30 plugin id 24845 published 2007-03-18 reporter Tenable source https://www.tenable.com/plugins/index.php?view=single&id=24845 title Solaris 10 (sparc) : 123590-12 (deprecated) NASL family Oracle Linux Local Security Checks NASL id ORACLELINUX_ELSA-2007-0336.NASL description From Red Hat Security Advisory 2007:0336 : Updated postgresql packages that fix several security issues are now available for Red Hat Enterprise Linux 3, 4, and 5. This update has been rated as having moderate security impact by the Red Hat Security Response Team. PostgreSQL is an advanced Object-Relational database management system (DBMS). A flaw was found in the way PostgreSQL allows authenticated users to execute security-definer functions. It was possible for an unprivileged user to execute arbitrary code with the privileges of the security-definer function. (CVE-2007-2138) Users of PostgreSQL should upgrade to these updated packages containing PostgreSQL version 8.1.9, 7.4.17, and 7.3.19 which corrects this issue. last seen 2020-06-01 modified 2020-06-02 plugin id 67488 published 2013-07-12 reporter This script is Copyright (C) 2013-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/67488 title Oracle Linux 3 / 4 / 5 : postgresql (ELSA-2007-0336) NASL family Fedora Local Security Checks NASL id FEDORA_2008-0552.NASL description - Mon Jan 7 2008 Tom Lane <tgl at redhat.com> 8.2.6-1 - Update to PostgreSQL 8.2.6 to fix CVE-2007-4769, CVE-2007-4772, CVE-2007-6067, CVE-2007-6600, CVE-2007-6601 - Make initscript and pam config files be installed unconditionally; seems new buildroots don last seen 2020-06-01 modified 2020-06-02 plugin id 29948 published 2008-01-14 reporter This script is Copyright (C) 2008-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/29948 title Fedora 7 : postgresql-8.2.6-1.fc7 (2008-0552)
Oval
accepted | 2013-04-29T04:01:30.379-04:00 | ||||||||||||||||||||||||||||||||
class | vulnerability | ||||||||||||||||||||||||||||||||
contributors |
| ||||||||||||||||||||||||||||||||
definition_extensions |
| ||||||||||||||||||||||||||||||||
description | Untrusted search path vulnerability in PostgreSQL before 7.3.19, 7.4.x before 7.4.17, 8.0.x before 8.0.13, 8.1.x before 8.1.9, and 8.2.x before 8.2.4 allows remote authenticated users, when permitted to call a SECURITY DEFINER function, to gain the privileges of the function owner, related to "search_path settings." | ||||||||||||||||||||||||||||||||
family | unix | ||||||||||||||||||||||||||||||||
id | oval:org.mitre.oval:def:10090 | ||||||||||||||||||||||||||||||||
status | accepted | ||||||||||||||||||||||||||||||||
submitted | 2010-07-09T03:56:16-04:00 | ||||||||||||||||||||||||||||||||
title | Untrusted search path vulnerability in PostgreSQL before 7.3.19, 7.4.x before 7.4.17, 8.0.x before 8.0.13, 8.1.x before 8.1.9, and 8.2.x before 8.2.4 allows remote authenticated users, when permitted to call a SECURITY DEFINER function, to gain the privileges of the function owner, related to "search_path settings." | ||||||||||||||||||||||||||||||||
version | 27 |
Redhat
advisories |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
rpms |
|
References
- http://rhn.redhat.com/errata/RHSA-2007-0336.html
- http://secunia.com/advisories/24989
- http://secunia.com/advisories/24999
- http://secunia.com/advisories/25005
- http://secunia.com/advisories/25019
- http://secunia.com/advisories/25037
- http://secunia.com/advisories/25058
- http://secunia.com/advisories/25184
- http://secunia.com/advisories/25238
- http://secunia.com/advisories/25334
- http://secunia.com/advisories/25717
- http://secunia.com/advisories/25720
- http://secunia.com/advisories/25725
- http://security.gentoo.org/glsa/glsa-200705-12.xml
- http://sunsolve.sun.com/search/document.do?assetkey=1-26-102894-1
- http://support.avaya.com/elmodocs2/security/ASA-2007-190.htm
- http://www.debian.org/security/2007/dsa-1309
- http://www.debian.org/security/2007/dsa-1311
- http://www.mandriva.com/security/advisories?name=MDKSA-2007:094
- http://www.postgresql.org/about/news.791
- http://www.postgresql.org/support/security.html
- http://www.redhat.com/support/errata/RHSA-2007-0337.html
- http://www.securityfocus.com/bid/23618
- http://www.securitytracker.com/id?1017974
- http://www.trustix.org/errata/2007/0015/
- http://www.ubuntu.com/usn/usn-454-1
- http://www.vupen.com/english/advisories/2007/1497
- http://www.vupen.com/english/advisories/2007/1549
- https://exchange.xforce.ibmcloud.com/vulnerabilities/33842
- https://issues.rpath.com/browse/RPL-1292
- https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A10090