CVE-2016-4472: Buffer Overflow

Published Jun 9, 2016
·
Updated

It was found that original patch for issues CVE-2015-1283 and CVE-2015-2716 used overflow checks that could be optimized out by some compilers applying certain optimization settings, which can cause the vulnerability to remain even after applying the patch.

One pattern in the fix for CVE-2015-1283/CVE-2015-2716 is:

/ bufferSize is positive here / do { bufferSize = 2; } while (bufferSize < neededSize && bufferSize > 0); if (bufferSize <= 0) { errorCode = XMLERRORNOMEMORY; return NULL;

Any of the modern optimizing compiler, IF able to infer that bufferSize is initially positive (which is true but not obvious to see through local reasoning), will eliminate bufferSize > 0 as always true when the execution is defined, and bufferSize <= 0 as always false when the execution is defined.

Without knowing that bufferSize starts positive, an optimizing compiler could also move the test bufferSize > 0 out of the loop, that is, compile the code as if it had been written:

if (bufferSize <= 0) errorCode = XMLERRORNOMEMORY; return NULL; else { do { bufferSize = 2; } while (bufferSize < neededSize); }

Both cases leads to not eliminating the vulnerability.

Upstream patch:

https://sourceforge.net/p/expat/codegit/ci/f0bec73b018caa07d3e75ec8dd967f3785d71bde/tree/expat/lib/xmlparse.c?diff=a238d7ea7a715ef3850c4cbdd86aeda7077b6bbc

Other sources

The overflow protection in Expat is removed by compilers with certain optimization settings, which allows remote attackers to cause a denial of service (crash) or possibly execute arbitrary code via crafted XML data. NOTE: this vulnerability exists because of an incomplete fix for CVE-2015-1283 and CVE-2015-2716.

MITRE

Affected Software

9 affected componentsFixes available
Libexpat Project Libexpat<=2.1.1
Canonical Ubuntu Linux=12.04
McAfee Policy Auditor<6.5.1
Python Python>=2.7.0<2.7.15
Python Python>=3.3.0<3.3.7
Python Python>=3.4.0<3.4.7
Python Python>=3.5.0<3.5.4
Python Python>=3.6.0<3.6.2
debian/expat
2.2.10-2+deb11u52.2.10-2+deb11u62.5.0-1+deb12u12.7.1-1

Event History

Jun 9, 2016
Data Sourced
via Red Hat·09:31 AM
DescriptionSeverityAffected Software
Jun 30, 2016
CVE Published
via MITRE·05:00 PM
Data Sourced
via MITRE·05:00 PM
Description
Jan 11, 2024
Data Sourced
via Launchpad·10:17 PM
Description
Jan 18, 2025
Data Sourced
via Ubuntu·01:40 AM
RemedyDescriptionSeverityAffected Software
Mar 31, 2025
Data Sourced
via Debian·03:25 AM
DescriptionAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is CVE-2016-4472?

CVE-2016-4472 refers to a vulnerability in Expat that allows remote attackers to cause a denial of service or possibly execute arbitrary code via crafted XML data.

2

What is the severity of CVE-2016-4472?

The severity of CVE-2016-4472 is rated as high with a CVSS score of 8.1.

3

How does CVE-2016-4472 affect Expat?

CVE-2016-4472 affects Expat by removing the overflow protection in certain optimization settings, making it susceptible to crashing or arbitrary code execution.

4

Which software versions are affected by CVE-2016-4472?

The affected software versions include xmlrpc-c 1.16.33-3.1ubuntu5.2, libxmltok 1.2-4ubuntu0.18.04.1~, libxmltok 1.2-4ubuntu0.20.04.1~, libxmltok 1.2-3ubuntu0.16.04.1~, libxmltok 1.2-4ubuntu0.22.04.1~, expat 2.2.6-2+deb10u4, expat 2.2.6-2+deb10u6, expat 2.2.10-2+deb11u5, expat 2.5.0-1, and expat 2.5.0-2.

5

Where can I find more information about CVE-2016-4472?

More information about CVE-2016-4472 can be found on the following references: [link1](https://access.redhat.com/security/cve/CVE-2015-1283), [link2](https://access.redhat.com/security/cve/CVE-2015-2716), [link3](https://sourceforge.net/p/expat/code_git/ci/f0bec73b018caa07d3e75ec8dd967f3785d71bde/tree/expat/lib/xmlparse.c?diff=a238d7ea7a715ef3850c4cbdd86aeda7077b6bbc).

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203