Commit 393590a
Security: harden user-import XML parsing against XXE
The user import/update XML parsing relied entirely on the libxml runtime
default to avoid external entity resolution, leaving the code unhardened on
PHP < 8 or misconfigured environments.
Explicitly block external entity loading with a null
libxml_set_external_entity_loader() around each addXmlContent() call (user
import and update flows), restoring the default loader afterwards. This is
the non-deprecated, PHP 8.x-safe equivalent and does not enable entity
substitution (LIBXML_NOENT is intentionally not used).
Refs GHSA-h24x-xw47-2wwx
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 4ebcf1a commit 393590a
3 files changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
454 | 457 | | |
455 | 458 | | |
| 459 | + | |
456 | 460 | | |
457 | 461 | | |
458 | 462 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
250 | 253 | | |
251 | 254 | | |
| 255 | + | |
252 | 256 | | |
253 | 257 | | |
254 | 258 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3106 | 3106 | | |
3107 | 3107 | | |
3108 | 3108 | | |
| 3109 | + | |
| 3110 | + | |
| 3111 | + | |
3109 | 3112 | | |
3110 | 3113 | | |
| 3114 | + | |
3111 | 3115 | | |
3112 | 3116 | | |
3113 | 3117 | | |
| |||
0 commit comments