Skip to content

Fix #505: Prevent silent XXE on PHP < 8.0 - #506

Merged
JamesHeinrich merged 1 commit into
JamesHeinrich:masterfrom
Ikram-4:fix/xxe-silent-failure-505
Sep 10, 2026
Merged

JamesHeinrich merged 1 commit into
JamesHeinrich:masterfrom
Ikram-4:fix/xxe-silent-failure-505

Conversation

@Ikram-4

@Ikram-4 Ikram-4 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Fixes #505

Changes

  1. Removed @ error suppression from libxml_disable_entity_loader() calls in XML2array() (lines 749, 752). On PHP < 8.0, if this call fails silently, external entity loading remains enabled, allowing XXE attacks via crafted media metadata.

  2. Added explicit failure check: if libxml_disable_entity_loader(true) fails, the function now returns false instead of proceeding to parse untrusted XML with external entities enabled.

  3. Added LIBXML_NOENT to GETID3_LIBXML_OPTIONS as defence-in-depth, explicitly disabling external entity substitution at the libxml parser level.

Impact

  • PHP < 8.0: Prevents XXE (file read, SSRF, billion laughs DoS) via crafted audio/video metadata
  • PHP 8.0+: No change in behavior (external entities already disabled by default)

…y_loader() and add LIBXML_NOENT

- Remove @ error suppression on libxml_disable_entity_loader() calls
  in XML2array() so failures are not silently ignored on PHP < 8.0
- Add explicit check: if disabling entity loading fails, return false
  instead of proceeding with XXE enabled
- Add LIBXML_NOENT to GETID3_LIBXML_OPTIONS as defence-in-depth to
  explicitly disable external entity substitution at the parser level

Ref: CWE-611, JamesHeinrich#505
@JamesHeinrich
JamesHeinrich merged commit ce50b4b into JamesHeinrich:master Sep 10, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Silent failure of @libxml_disable_entity_loader() enables XXE on PHP < 8.0 (CWE-611)

2 participants