These functions now support options to control the access of external entities, in particular
- allow-external-entities: whether external entities are permitted (true) or rejected (false), default true
- dtd: whether external entities are processed (true) or ignored (false), default true.
In fact option dtd is not completely new, but previously its value was taken from the context option DTD, which defaults to false. So with 11.8, you could produce the same directory listing, that you experienced with 11.9, by running this on the document that you provided:
basex -ODTD=yes "doc('doc.xml')"
Now the options can be supplied per function call, they are independent of the context options, and the defaults are different. To restore the result that you were used to with 11.9, you need to run:
basex "doc('doc.xml', { 'dtd': false() })"
Gesendet: Freitag, 2. Mai 2025 um 09:38
Von: "Nico Verwer (Rakensi)" <nverwer@rakensi.com>
An: basex-talk@mailman.uni-konstanz.de
Betreff: [basex-talk] Security problem in 11.9?
Hello everyone on the list!
There is a change between 11.8 and 11.9, related to security settings.
This has to do with the following document:
<?xml version="1.0"?>
<!DOCTYPE foo [
<!ELEMENT foo ANY >
]>
<foo>&xxe;</foo>
When parsing this document, BaseX11.8 threw an error with code
err:FODC0002, which means that the resource cannot be retrieved.
BaseX 11.9 gives a listing of the root directory of my computer. This can be used to retrieve all files on my computer, which is a security risk.