CVE-2019-17626: Reportlab XML Injection Vulnerability

CRITICAL
Advisory Identifier: GHSA-qpg2-vx7j-3869
CVSS 9.8
CWE-91
Published
Advisory Summary

CVE-2019-17626 is a CRITICAL (CVSS 9.8) xml injection vulnerability (CWE-91: XML Injection (aka Blind XPath Injection)) affecting Reportlab libraries in the PyPI ecosystem. The issue involves xml injection in reportlab. Remediation is available by upgrading affected packages to version 3.5.28.

CVE-2019-17626 at a Glance

CVE Identifier CVE-2019-17626
GHSA Identifier GHSA-qpg2-vx7j-3869
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-91: XML Injection (aka Blind XPath Injection)
Affected Product Reportlab
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 9.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2019-17626

To remediate this vulnerability, upgrade all affected Reportlab dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

reportlab fixed: 3.5.28
pip install reportlab>=3.5.28
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show reportlab

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2019-17626, inspect your installed packages using pip:

pip show reportlab

Analyze the terminal output to locate any version of Reportlab in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.5.28), your application is affected.

Note: The pip show reportlab command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-91: XML Injection (aka Blind XPath Injection), where the product does not properly neutralize special elements that are used in xml, allowing attackers to modify the syntax, content, or commands of the xml before it is processed by an end system. In Reportlab, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

ReportLab through 3.5.26 allows remote code execution because of toColor(eval(arg)) in colors.py, as demonstrated by a crafted XML document with '<span color="' followed by arbitrary Python code.

CVE-2019-17626 Affected Reportlab Versions

1 component(s)
Fixed Versions:
3.5.28
Product / Package Ecosystem Affected Versions Fixed Version
reportlab
PyPI
< 3.5.28
3.5.28

References

NVD — CVE-2019-17626 NVD
https://nvd.nist.gov/vuln/detail/CVE-2019-17626
Reportlab Security Information SECURITY
https://www.debian.org/security/2020/dsa-4663
web.archive.org/web/20191016111823/... WEB
https://web.archive.org/web/20191016111823/https://bitbucket.org/rptlab/reportlab/issues/199/eval-in-colorspy-leads-to-remote-code
usn.ubuntu.com/4273-1 WEB
https://usn.ubuntu.com/4273-1
Reportlab Security Information SECURITY
https://security.netapp.com/advisory/ntap-20240719-0006
Reportlab Security Information SECURITY
https://security.gentoo.org/glsa/202007-35
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZZPHP2BJSTP4IYCSJRQINP763IHO6ASL
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/NSCTOE3DITFICY2XKBYZ5WAF5TSQ52DM
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ZZPHP2BJSTP4IYCSJRQINP763IHO6ASL
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/NSCTOE3DITFICY2XKBYZ5WAF5TSQ52DM
lists.debian.org/debian-lts-announce... WEB
https://lists.debian.org/debian-lts-announce/2020/02/msg00019.html
Reportlab Security Information SECURITY
https://hg.reportlab.com/hg-public/reportlab/rev/51a521ad7dd3
Reportlab Source Repository REPOSITORY
https://github.com/pypa/advisory-database/tree/main/vulns/reportlab/PYSEC-2019-117.yaml
GitHub Advisory / Wiki ADVISORY
https://github.com/advisories/GHSA-qpg2-vx7j-3869
Reportlab Source Repository REPOSITORY
https://github.com/MrBitBucket/reportlab-mirror
bitbucket.org/rptlab/reportlab/sr... WEB
https://bitbucket.org/rptlab/reportlab/src/default/CHANGES.md
bitbucket.org/rptlab/reportlab/is... WEB
https://bitbucket.org/rptlab/reportlab/issues/199/eval-in-colorspy-leads-to-remote-code
Reportlab Security Information SECURITY
https://access.redhat.com/security/cve/cve-2019-17626
access.redhat.com/errata/rhsa-2020:02... WEB
https://access.redhat.com/errata/RHSA-2020:0230
access.redhat.com/errata/rhsa-2020:02... WEB
https://access.redhat.com/errata/RHSA-2020:0201
access.redhat.com/errata/rhsa-2020:01... WEB
https://access.redhat.com/errata/RHSA-2020:0197
access.redhat.com/errata/rhsa-2020:01... WEB
https://access.redhat.com/errata/RHSA-2020:0195
Reportlab Security Information SECURITY
http://lists.opensuse.org/opensuse-security-announce/2020-02/msg00002.html

Frequently Asked Questions

What is CVE-2019-17626?
CVE-2019-17626 is a security vulnerability in Reportlab involving XML Injection in ReportLab under CWE-91: XML Injection (aka Blind XPath Injection).
Which Reportlab versions are affected?
Affected versions include releases prior to 3.5.28 across affected packages: reportlab.
What version fixes CVE-2019-17626?
Upgrading to 3.5.28 (or the latest patched release for your respective branch) resolves the vulnerability.
Is reportlab affected?
Yes, reportlab is affected in releases prior to 3.5.28. Upgrade your dependency to 3.5.28 or later.
What is the CVSS score of CVE-2019-17626?
CVE-2019-17626 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2019-17626?
CVE-2019-17626 is classified under CWE-91: XML Injection (aka Blind XPath Injection) (The product does not properly neutralize special elements that are used in XML, allowing attackers to modify the syntax, content, or commands of the XML before it is processed by an end system.).
How can I check PyPI dependencies for CVE-2019-17626?
Run the dependency tree command: 'pip show reportlab'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-qpg2-vx7j-3869",
  "modified" : "2024-10-26T22:32:16Z",
  "published" : "2022-05-24T22:00:57Z",
  "aliases" : [ "CVE-2019-17626" ],
  "summary" : "XML Injection in ReportLab",
  "details" : "ReportLab through 3.5.26 allows remote code execution because of toColor(eval(arg)) in colors.py, as demonstrated by a crafted XML document with '<span color=\"' followed by arbitrary Python code.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "reportlab"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.5.28"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-17626"
  }, {
    "type" : "WEB",
    "url" : "https://www.debian.org/security/2020/dsa-4663"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20191016111823/https://bitbucket.org/rptlab/reportlab/issues/199/eval-in-colorspy-leads-to-remote-code"
  }, {
    "type" : "WEB",
    "url" : "https://usn.ubuntu.com/4273-1"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20240719-0006"
  }, {
    "type" : "WEB",
    "url" : "https://security.gentoo.org/glsa/202007-35"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZZPHP2BJSTP4IYCSJRQINP763IHO6ASL"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/NSCTOE3DITFICY2XKBYZ5WAF5TSQ52DM"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ZZPHP2BJSTP4IYCSJRQINP763IHO6ASL"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/NSCTOE3DITFICY2XKBYZ5WAF5TSQ52DM"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2020/02/msg00019.html"
  }, {
    "type" : "WEB",
    "url" : "https://hg.reportlab.com/hg-public/reportlab/rev/51a521ad7dd3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/reportlab/PYSEC-2019-117.yaml"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-qpg2-vx7j-3869"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/MrBitBucket/reportlab-mirror"
  }, {
    "type" : "WEB",
    "url" : "https://bitbucket.org/rptlab/reportlab/src/default/CHANGES.md"
  }, {
    "type" : "WEB",
    "url" : "https://bitbucket.org/rptlab/reportlab/issues/199/eval-in-colorspy-leads-to-remote-code"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/security/cve/cve-2019-17626"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2020:0230"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2020:0201"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2020:0197"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2020:0195"
  }, {
    "type" : "WEB",
    "url" : "http://lists.opensuse.org/opensuse-security-announce/2020-02/msg00002.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-91" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-06-27T16:52:31Z",
    "nvd_published_at" : "2019-10-16T12:15:00Z"
  }
}