xmlSchemaPreRun in xmlschemas.c in libxml2 2.9.10 allows an xmlSchemaValidateStream memory leak. Reference and upstream commit: https://gitlab.gnome.org/GNOME/libxml2/merge_requests/68
Created libxml2 tracking bugs for this issue: Affects: fedora-all [bug 1799736] Created mingw-libxml2 tracking bugs for this issue: Affects: epel-7 [bug 1799739] Affects: fedora-all [bug 1799738]
Function xmlSchemaValidateStream() in xmlschemas.c calls xmlSchemaSAXPlug(), which calls xmlSchemaPreRun(). xmlSchemaPreRun() sets `vctxt->xsiAssemble = 0;`, then if vctxt->schema is NULL it sets `vctxt->xsiAssemble = 1;` and it allocates a new schema, storing the pointer in vctxt->schema. Function xmlSchemaPostRun() is supposed to free the schema, but it does so only if vctxt->xsiAssemble's value is not 0. This is not the case sometimes, because function xmlSchemaValidateStream(), after having called xmlSchemaSAXPlug(), also calls xmlSchemaVStart() which calls again xmlSchemaPreRun(). As said, this last function initially sets `vctxt->xsiAssemble = 0;`, thus preventing the code to free the previously allocated schema.
This issue has been addressed in the following products: JBoss Core Services on RHEL 6 JBoss Core Services on RHEL 7 Via RHSA-2020:2644 https://access.redhat.com/errata/RHSA-2020:2644
This issue has been addressed in the following products: Red Hat JBoss Core Services Via RHSA-2020:2646 https://access.redhat.com/errata/RHSA-2020:2646
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-2019-20388
This issue has been addressed in the following products: Red Hat Enterprise Linux 7 Via RHSA-2020:3996 https://access.redhat.com/errata/RHSA-2020:3996
This issue has been addressed in the following products: Red Hat Enterprise Linux 8 Via RHSA-2020:4479 https://access.redhat.com/errata/RHSA-2020:4479