CVE-2024-8176: Libexpat: expat: improper restriction of xml entity expansion depth in libexpat
A stack overflow vulnerability exists in the libexpat library due to the way it handles recursive entity expansion in XML documents. When parsing an XML document with deeply nested entity references, libexpat can be forced to recurse indefinitely, exhausting the stack space and causing a crash. This issue could lead to denial of service (DoS) or, in some cases, exploitable memory corruption, depending on the environment and library usage.
Other sources
afpfs. The issue was addressed with improved memory handling.
— Apple
afpfs. This issue was addressed with improved checks.
— Apple
AirDrop. A permissions issue was addressed with additional restrictions.
— Apple
Apple Intelligence Reports. A permissions issue was addressed with additional restrictions.
— Apple
AppleJPEG. The issue was addressed with improved input sanitization.
— Apple
Credit
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 13.7.6 - Upgrade
Upgrade
Apple macOSto a version that resolves this vulnerability.Fixed in 14.7.6 - Upgrade
Upgrade
macOS Venturato a version that resolves this vulnerability.Fixed in 13.7.6 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 7.2.6 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 11.5 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 17.7.7 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 18.5 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 15.5 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 2.5 - Upgrade
Upgrade
debian/expatto a version that resolves this vulnerability.Fixed in 2.5.0-1+deb12u2Fixed in 2.7.1-2Fixed in 2.8.2-1 - Upgrade
Upgrade
libexpatto a version that resolves this vulnerability.Fixed in 2.7.3Patch CVE-2024-8176 - Upgrade
Upgrade
libexpatto a version that resolves this vulnerability.Fixed in 2.7.3Patch CVE-2025-59375 - Compensating control
Reduce exposure by restricting the ability to supply XML documents to the affected Expat/libexpat parsing context; only allow XML from trusted sources/app workflows to prevent triggering the uncontrolled recursive entity expansion (stack overflow) described for CVE-2024-8176.
Event History
Parent advisories
This vulnerability appears in the following advisories.
Peer vulnerabilities
Found alongside the following vulnerabilities.
- CVE-2025-31240
- CVE-2025-31237
- CVE-2025-31251
- CVE-2025-31235
- CVE-2025-31208
- CVE-2025-31196
- CVE-2025-31209
- CVE-2025-31239
- CVE-2025-31233
- CVE-2025-30453
- CVE-2025-24258
- CVE-2025-30448
- CVE-2025-31232
- CVE-2025-24144
- CVE-2025-31219
- CVE-2025-31241
- CVE-2024-8176
- CVE-2025-30440
- CVE-2025-31222
- CVE-2025-24274
- CVE-2025-24142
- CVE-2025-31245
- CVE-2025-31224
- CVE-2025-31221
- CVE-2025-31213
- CVE-2025-31247
- CVE-2025-30442
- CVE-2025-31242
- CVE-2025-31220
- CVE-2025-24155
- CVE-2025-31246
- CVE-2025-26465
- CVE-2025-26466
- CVE-2025-31212
- CVE-2025-31200
- CVE-2025-31226
- CVE-2025-24224
- CVE-2025-24213
- CVE-2025-31223
- CVE-2025-31238
- CVE-2025-24223
- CVE-2025-31204
- CVE-2025-31217
- CVE-2025-31215
- CVE-2025-31206
- CVE-2025-31205
- CVE-2025-31257
- CVE-2025-43374
- CVE-2025-24097
- CVE-2025-24111
- CVE-2025-31210
- CVE-2025-24225
- CVE-2025-31228
- CVE-2025-24259
- CVE-2025-31216
- CVE-2025-31214
- CVE-2025-31225
- CVE-2025-31253
- CVE-2025-31207
- CVE-2025-31227
- CVE-2025-31234
- CVE-2025-31260
- CVE-2025-24222
- CVE-2025-31236
- CVE-2025-30443
- CVE-2025-31218
- CVE-2025-31256
- CVE-2025-31244
- CVE-2025-31258
- CVE-2025-31266
- CVE-2025-31249
- CVE-2025-31259
- CVE-2025-31250
- CVE-2025-31248
Frequently Asked Questions
What is the severity of CVE-2024-8176?
CVE-2024-8176 is classified as a high-severity vulnerability due to its potential to lead to a denial of service through stack overflow.
What software is affected by CVE-2024-8176?
CVE-2024-8176 affects the Expat libexpat library, particularly in its handling of XML documents.
How can I mitigate the risks associated with CVE-2024-8176?
To mitigate CVE-2024-8176, it is recommended to update to the latest version of libexpat, which addresses this vulnerability.
How does CVE-2024-8176 affect XML parsing?
CVE-2024-8176 allows malicious XML documents with deeply nested entity references to cause endless recursion, leading to stack exhaustion during parsing.
What is the cause of the vulnerability identified in CVE-2024-8176?
The vulnerability in CVE-2024-8176 is caused by improper handling of recursive entity expansion in the libexpat library.