On Wed, Jan 30, 2013 at 1:02 AM, Takahiro Hozumi <fat...@googlemail.com>wrote:

> As more and more projects are using edn format for config,
> communication and etc, I think that default value of *read-eval*,
> which is true, is source of vulnerability such as recently reported
> ring issue [1].
>

Slight diversion here - what is the approved and safe way to read data from
an untrusted source?  I had a task this week which required data to to be
read via an API.  I wanted to use clojure data/EDN, and ended up with three
primary issues:

1 - *read-eval*, which I bound to false
2 - data literals - I don't know which data literals are truly safe from an
external source.  I rebound *data-readers* to make sure only the system
readers were around, which I assume are thought to be safe
3 - read-string only reads one expression, silently ignoring additional
characters.  I assume I could solve this using read and checking for
additional items and raising an error if more expressions were received
than expected

In the end, I re-implemented this API using JSON, where there are no safety
issues parsing data.  This is an unfortunate decision, and I'd like to
enable the clojure data version.  I'm just not sure whether or not using
read/read-string is intended to be a safe reader in the long term.  If it's
not, maybe we need a set of functions that are blessed for use with
untrusted data?

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to