I was asked this by a friend, and I couldn't find any information about whether this vulnerability exists in nxml-mode as current or not. I specifically mean this billion laughs attack.

1 Answer 1


Well that's incredibly easy to test, right?

Fire up a new Emacs instance, open a new XML file, paste in the code, see whether Emacs explodes.

(Spoiler: Yes, it does.)

  • FWIW, Emacs' pure Emacs Lisp XML parser (xml-parse-region) does so as well, whereas libxml (libxml-parse-region) refuses to parse it and silently fails with nil.
    – user227
    Jul 20, 2016 at 15:09
  • I would expect anything to be vulnerable to this unless it's been hardened against it. libxml is one of these exceptions.
    – wasamasa
    Jul 20, 2016 at 16:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.