I asked this question a long time ago, and I answer my question, because additional information appeared, and approaches also appeared, and another question did not correctly address the problem.
In principle, reading functions are not safe by default.
In 2013, the Clojure groups discussed heated discussions after all Ruby exploits (where people suddenly felt worried about the security implications) in this thread, in the discussion thread:
"read-eval defaulting false"
The Clojure docs themselves clearly state that:
http://clojuredocs.org/clojure_core/clojure.core/read
;; WARNING: You SHOULD NOT use clojure.core/read or ;; clojure.core/read-string to read data from untrusted sources. They ;; were designed only for reading Clojure code and data from trusted ;; sources
Please note that even setting read-eval to false is not enough (at least not up, at least until Clojure 1.5), because some Java constructors can be called and have a side effect by carefully creating malicious inputs.
This is explained in detail in a blog post: "Clojure Reader is unsafe"
http://www.learningclojure.com/2013/02/clojures-reader-is-unsafe.html
In short: use something else like clojure.edn .
source share