Bug 1852985 (CVE-2020-13692) - CVE-2020-13692 postgresql-jdbc: XML external entity (XXE) vulnerability in PgSQLXML
Summary: CVE-2020-13692 postgresql-jdbc: XML external entity (XXE) vulnerability in Pg...
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2020-13692
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1855484 1855485 1855486 1855487 1855488 1855489 1855490 1861447
Blocks: 1852986
TreeView+ depends on / blocked
 
Reported: 2020-07-01 17:07 UTC by Guilherme de Almeida Suckevicz
Modified: 2021-01-13 18:01 UTC (History)
55 users (show)

Fixed In Version: postgresql-jdbc 42.2.13
Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in PostgreSQL JDBC in versions prior to 42.2.13. An XML External Entity (XXE) weakness was found in PostgreSQL JDBC. The highest threat from this vulnerability is to data confidentiality and system availability.
Clone Of:
Environment:
Last Closed: 2020-07-21 01:27:38 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:3206 0 None None None 2020-07-29 11:56:36 UTC
Red Hat Product Errata RHBA-2020:3311 0 None None None 2020-08-04 13:32:05 UTC
Red Hat Product Errata RHBA-2020:3376 0 None None None 2020-08-10 02:08:54 UTC
Red Hat Product Errata RHBA-2020:3481 0 None None None 2020-08-18 11:09:14 UTC
Red Hat Product Errata RHBA-2020:3482 0 None None None 2020-08-18 11:14:48 UTC
Red Hat Product Errata RHBA-2020:3540 0 None None None 2020-08-24 11:42:03 UTC
Red Hat Product Errata RHSA-2020:3005 0 None None None 2020-07-20 20:50:00 UTC
Red Hat Product Errata RHSA-2020:3176 0 None None None 2020-07-28 12:49:53 UTC
Red Hat Product Errata RHSA-2020:3209 0 None None None 2020-07-29 15:21:49 UTC
Red Hat Product Errata RHSA-2020:3248 0 None None None 2020-07-30 13:36:01 UTC
Red Hat Product Errata RHSA-2020:3283 0 None None None 2020-08-03 16:07:54 UTC
Red Hat Product Errata RHSA-2020:3284 0 None None None 2020-08-03 17:02:47 UTC
Red Hat Product Errata RHSA-2020:3285 0 None None None 2020-08-03 17:13:17 UTC
Red Hat Product Errata RHSA-2020:3286 0 None None None 2020-08-03 16:53:22 UTC
Red Hat Product Errata RHSA-2020:3675 0 None None None 2020-09-08 09:33:11 UTC
Red Hat Product Errata RHSA-2020:3678 0 None None None 2020-09-08 09:45:06 UTC
Red Hat Product Errata RHSA-2020:5568 0 None None None 2020-12-16 12:14:45 UTC
Red Hat Product Errata RHSA-2021:0110 0 None None None 2021-01-13 18:01:33 UTC

Description Guilherme de Almeida Suckevicz 2020-07-01 17:07:51 UTC
PostgreSQL JDBC Driver (aka PgJDBC) before 42.2.13 allows XXE.

Reference:
https://jdbc.postgresql.org/documentation/changelog.html#version_42.2.13

Upstream commit:
https://github.com/pgjdbc/pgjdbc/commit/14b62aca4764d496813f55a43d050b017e01eb65

Comment 1 Jonathan Christison 2020-07-01 17:15:28 UTC
More info from the reporters blog - https://blog.daviddworken.com/posts/pgjdbc-xxe/

Comment 11 Jonathan Christison 2020-07-08 15:35:01 UTC
We disagree with some aspects of this base flaw's scoring and suggest the following corrections

Exploitability Metrics: 

Attack Vector Network (AV:N) -
Agree here, we cannot say we control the contents of the database, this could be XML (and DTD injection) derived from unsanitized input

Attack Complexity Low (AC:L) - Changed to Attack Complexity High (AC:H)
We have to assume the vulnerable component (SQLXML) is being used and specialized access conditions or extenuating circumstances do not exist for the read side of the attack however the caveat to this is the injection side of the flaw has elements outside the attackers control

* The attacker must have a method of injecting malicious XML into the database (unsanitized user input)
* The field type in the table must be typed as XML

Privileges Required None (PR:N) -
Agree here, the attacker does not need to be a privileged user eg. no login required to exploit the base flaw, again a caveat that we cannot take into scope is they will need to populate the postgres db table. 

User Interaction None (UI:N)
Agree here, a user does not need to be coerced into performing any action for this flaw, an attacker can expect the XML contained in the postgress DB to be parsed by the default document reader.

Scope Unchanged (S:U)
Agree here, the attacker will not be able to escape the scope of the executing JVM solely due to this flaw
 
Impact Metrics:

Confidentiality High (C:H)
Agree in principle here, the default xml parser will execute with the privileges of the JVM and any files accessible to it with the same permissions can be exfiltrated - The caveat being that depending on the implemntation and setup of the XML parser exfiltration can often be limited to single line strings and non-special files, using alternative protocols for exfiltration can often bypass these limitations 

Integrity High (I:H) - Changed to Integrity Low (I:L)
Agree in principle here, as there is possibility for SSRF and in some rare circumstances RCE via XXE but the latter requires very specific configuration which is outside of the attackers control, modification of data is possible, but the attacker does not have control over the consequence of a modification

* SSRF relies on external services to the postgresql jdbc driver on the target host
* RCE again relies on the presence of certain URL handlers and known attacks normally rely on some elements of SSRF 
    
Availability High (A:I)
Agree here, there is presitent for DoS attacks such as billion laughs attack as well as the likely event of the parser throwing an exception and exiting the application when parsing invalid XML

Comment 15 Jonathan Christison 2020-07-13 12:25:53 UTC
Marking AMQ Online as Low impact, this is because although the postgresql jdbc driver is shipped as part of the Technology Preview IoT functionality, it does not use, or support, the XML datatype field/SQLXML implementation, we believe this is a necessary factor for vulnerability to be practically exploitable.

Comment 26 errata-xmlrpc 2020-07-20 20:49:56 UTC
This issue has been addressed in the following products:

  Red Hat Integration Debezium 1.1.3

Via RHSA-2020:3005 https://access.redhat.com/errata/RHSA-2020:3005

Comment 27 Product Security DevOps Team 2020-07-21 01:27:38 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2020-13692

Comment 28 Product Security DevOps Team 2020-07-21 07:27:37 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2020-13692

Comment 47 errata-xmlrpc 2020-07-28 12:49:48 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2020:3176 https://access.redhat.com/errata/RHSA-2020:3176

Comment 51 Tomas Hoger 2020-07-28 16:05:32 UTC
Created postgresql-jdbc tracking bugs for this issue:

Affects: fedora-all [bug 1861447]

Comment 55 errata-xmlrpc 2020-07-29 15:21:46 UTC
This issue has been addressed in the following products:

  Red Hat AMQ Online 1.5.2 GA

Via RHSA-2020:3209 https://access.redhat.com/errata/RHSA-2020:3209

Comment 56 errata-xmlrpc 2020-07-30 13:35:57 UTC
This issue has been addressed in the following products:

  Red Hat build of Quarkus 1.3.4 SP1

Via RHSA-2020:3248 https://access.redhat.com/errata/RHSA-2020:3248

Comment 57 Tomas Hoger 2020-08-03 15:14:34 UTC
The fix for this issue disables processing of external entities and DTDs.  This change can possibly introduce a problem in deployments where processing of external entities or DTDs is required to properly parse values read from the database.  The following Red Hat Knowledgebase article describes how to re-enabled the functionality disabled by this fix:

https://access.redhat.com/articles/5266441

Note: Re-enabling processing of external entities and DTDs also re-introduces this security issue.  It should only be used when database only stores fully trusted XML documents.

Comment 58 errata-xmlrpc 2020-08-03 16:07:50 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.0 Update Services for SAP Solutions

Via RHSA-2020:3283 https://access.redhat.com/errata/RHSA-2020:3283

Comment 59 errata-xmlrpc 2020-08-03 16:53:18 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.1 Extended Update Support

Via RHSA-2020:3286 https://access.redhat.com/errata/RHSA-2020:3286

Comment 60 errata-xmlrpc 2020-08-03 17:02:44 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 6

Via RHSA-2020:3284 https://access.redhat.com/errata/RHSA-2020:3284

Comment 61 errata-xmlrpc 2020-08-03 17:13:13 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2020:3285 https://access.redhat.com/errata/RHSA-2020:3285

Comment 62 errata-xmlrpc 2020-09-08 09:33:04 UTC
This issue has been addressed in the following products:

  Red Hat Decision Manager

Via RHSA-2020:3675 https://access.redhat.com/errata/RHSA-2020:3675

Comment 63 errata-xmlrpc 2020-09-08 09:45:00 UTC
This issue has been addressed in the following products:

  Red Hat Process Automation

Via RHSA-2020:3678 https://access.redhat.com/errata/RHSA-2020:3678

Comment 64 errata-xmlrpc 2020-12-16 12:14:36 UTC
This issue has been addressed in the following products:

  Red Hat Fuse 7.8.0

Via RHSA-2020:5568 https://access.redhat.com/errata/RHSA-2020:5568

Comment 65 errata-xmlrpc 2021-01-13 18:01:28 UTC
This issue has been addressed in the following products:

  Red Hat Integration - Camel K - Tech-Preview 2

Via RHSA-2021:0110 https://access.redhat.com/errata/RHSA-2021:0110


Note You need to log in before you can comment on or make changes to this bug.