Commit graph

3 commits

Author SHA1 Message Date
Kim Alvefur
99a880ebe5 util.xml: Add an option to allow <?processing instructions?>
These should generally be safe to just ignore, which should be the
default behavior of Expat and LuaExpat
2022-02-04 20:47:39 +01:00
Jonas Schäfer
e0b15fcba3 util.xml: Do not allow doctypes, comments or processing instructions
Yes. This is as bad as it sounds. CVE pending.

In Prosody itself, this only affects mod_websocket, which uses util.xml
to parse the <open/> frame, thus allowing unauthenticated remote DoS
using Billion Laughs. However, third-party modules using util.xml may
also be affected by this.

This commit installs handlers which disallow the use of doctype
declarations and processing instructions without any escape hatch. It,
by default, also introduces such a handler for comments, however, there
is a way to enable comments nontheless.

This is because util.xml is used to parse human-facing data, where
comments are generally a desirable feature, and also because comments
are generally harmless.
2022-01-10 18:23:54 +01:00
Waqas Hussain
67293fc09f Port tests to the busted test runner 2017-09-15 17:07:57 -04:00