Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] Billion Laughs

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Rusty Harold <elharo AT ibiblio.org>
  • To: XOM interest <xom-interest AT lists.ibiblio.org>
  • Subject: [XOM-interest] Billion Laughs
  • Date: Fri, 2 May 2014 20:04:14 -0400

I've been thinking about adding some (optional) protection to XOM against
the billion laughs and similar attacks. My rough plan of attack is to allow
the client to set an approximate maximum size on the Builder. The internal
SAX handler would keep a running count of approximate memory used as it
creates objects. If that limit is exceeded, it throws an exception and
discards the document. Any thoughts?

One question is whether I try to count memory or characters used. The goal
here is not to be exact, just to prevent malicious documents from expanding
too much.

A second thing I'm thinking about are XXE attacks. Here my plans are a
little hazier. I could just give the Builder an option to abort if any
external entities are detected but that seems too coarse-grained. In some
scenarios you want to allow file access but restrict http. In others the
reverse is true. And some times it may be acceptable to load entities from
some domains but not others. Would anyone like to propose an API for
configuring such details?

--
Elliotte Rusty Harold
elharo AT ibiblio.org




Archive powered by MHonArc 2.6.24.

Top of Page