FreeBSD : PostgresSQL -- TYPE in pg_temp execute arbitrary SQL during `SECURITY DEFINER` execution (9de4c1c1-b9ee-11e9-82aa-6cc21735f730)

high Nessus Plugin ID 127549

Language:

Synopsis

The remote FreeBSD host is missing one or more security-related updates.

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('foo'::varchar)` and `length('foo')` are inexact, while `length('foo'::text)` is exact. As part of exploiting this vulnerability, the attacker uses `CREATE DOMAIN` to create a type in a `pg_temp` schema. The attack pattern and fix are similar to that for CVE-2007-2138.

Writing `SECURITY DEFINER` functions continues to require following the considerations noted in the documentation :

https://www.postgresql.org/docs/devel/sql-createfunction.html#SQL-CREA TEFUNCTION-SECURITY

Versions Affected: 11

In a database containing hypothetical, user-defined hash equality operators, an attacker could read arbitrary bytes of server memory.
For an attack to become possible, a superuser would need to create unusual operators. It is possible for operators not purpose-crafted for attack to have the properties that enable an attack, but we are not aware of specific examples.

Solution

Update the affected packages.

See Also

https://www.postgresql.org/about/news/1960/

http://www.nessus.org/u?a61e8eba

Plugin Details

Severity: High

ID: 127549

File Name: freebsd_pkg_9de4c1c1b9ee11e982aa6cc21735f730.nasl

Version: 1.6

Type: local

Published: 8/12/2019

Updated: 8/21/2020

Supported Sensors: Nessus

Risk Information

VPR

Risk Factor: Medium

Score: 5.9

CVSS v2

Risk Factor: Medium

Base Score: 6.5

Temporal Score: 4.8

Vector: CVSS2#AV:N/AC:L/Au:S/C:P/I:P/A:P

CVSS v3

Risk Factor: High

Base Score: 8.8

Temporal Score: 7.7

Vector: CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Temporal Vector: CVSS:3.0/E:U/RL:O/RC:C

Vulnerability Information

CPE: p-cpe:/a:freebsd:freebsd:postgresql10-server, p-cpe:/a:freebsd:freebsd:postgresql11-server, p-cpe:/a:freebsd:freebsd:postgresql94-server, p-cpe:/a:freebsd:freebsd:postgresql95-server, p-cpe:/a:freebsd:freebsd:postgresql96-server, cpe:/o:freebsd:freebsd

Required KB Items: Host/local_checks_enabled, Host/FreeBSD/release, Host/FreeBSD/pkg_info

Exploit Ease: No known exploits are available

Patch Publication Date: 8/8/2019

Vulnerability Publication Date: 8/8/2019

Reference Information

CVE: CVE-2019-10208, CVE-2019-10209

IAVB: 2019-B-0072-S