Closed topipoh closed 9 months ago
Thanks for letting me know! While this is a breaking change, I think for a security issue, it makes sense. I'll make the change and issue a new release today.
This is resolved in me.flowthing/sigel {:mvn/version "1.1.0"}
:
λ clj -Srepro -Sdeps '{:deps {me.flowthing/sigel {:mvn/version "1.0.3"}}}'
Clojure 1.11.1
user=> (require '[sigel.xpath.core :as xpath])
nil
user=> (xpath/value-of "<!DOCTYPE x [<!ELEMENT x ANY> <!ENTITY xxe SYSTEM 'file:///etc/hostname'>]><x>&xxe;</x>" "/x")
Execution error (FileNotFoundException) at java.io.FileInputStream/open0 (FileInputStream.java:-2).
/etc/hostname (No such file or directory)
user=>
λ clj -Srepro -Sdeps '{:deps {me.flowthing/sigel {:mvn/version "1.1.0"}}}'
Clojure 1.11.1
user=> (require '[sigel.xpath.core :as xpath])
nil
user=> (xpath/value-of "<!DOCTYPE x [<!ELEMENT x ANY> <!ENTITY xxe SYSTEM 'file:///etc/hostname'>]><x>&xxe;</x>" "/x")
""
user=>
Hi!
Thanks for writing sigel, we've been very happy with it.
Today we noticed that the default Saxon configuration might make us vulnerable to XXE attacks:
https://www.illucit.com/en/java/saxon-he-external-entity-processing-xxe
/tmp/test.xml
We can fix this by using our own builder instead of sigel.protocols/build:
Do you think it would be a good idea to disable external general entities by default in sigel.saxon/processor?
Something like: