mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2026-04-24 21:06:02 +03:00
[GH-ISSUE #2805] Set XML_PARSE_NONET on xmlReadMemory calls #1303
Labels
No labels
bug
bug
dataloss
duplicate
enhancement
feature request
help wanted
invalid
need info
performance
pull-request
question
question
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/s3fs-fuse#1303
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @CarstenGrohmann on GitHub (Feb 22, 2026).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/2805
All
xmlReadMemory()calls in the codebase passoptions = 0:github.com/s3fs-fuse/s3fs-fuse@b41e43df8a/src/s3fs_xml.cpp (L467)github.com/s3fs-fuse/s3fs-fuse@b41e43df8a/src/s3fs.cpp (L3673)github.com/s3fs-fuse/s3fs-fuse@b41e43df8a/src/mpu_util.cpp (L115)S3 responses never contain DTDs or entity references. Setting
XML_PARSE_NONET(available since libxml2 2.6) would explicitly prevent the parser from making network requests during entity resolution. On libxml2 >= 2.13,XML_PARSE_NO_XXEcan additionally disable all external entity and DTD loading.Currently, the code relies on libxml2 >= 2.9 defaulting to safe behavior, but doesn't declare it explicitly. A one-line flag per call would fix this.
Without the flags an attacker who can manipulate S3 responses (MITM, rogue S3-compatible endpoint) could potentially:
I'd be happy to submit a PR.
@ggtakec commented on GitHub (Feb 22, 2026):
@CarstenGrohmann Thank you.
It seems that there is no reference to an external entity when connecting to AWS S3, but it certainly seems like consideration is needed for S3 compatibility and routing.
If you are able to fix this, could you please submit a PR?
Thanks in advance for your great help.