• Pl chevron_right

      Mathieu Pasquet: slixmpp v1.18.0

      news.movim.eu / PlanetJabber • 14:10 • 2 minutes

    Here is a new version for slixmpp, the python XMPP library.

    The highlight of this release is a fix for a possible man-in-the-middle, so I encourage everyone to upgrade, or apply a patch against their old version if required.

    Thanks to all contributors for this release!

    Security

    Handling of the error in previous versions would allow attackers to redirect the stream before STARTTLS. Direct TLS (added in slixmpp 1.10.0 and preferred) is not affected.

    The fixed code does not change the domain for which the connection is for, forcing the server handling the redirect to present a valid certificate for the domain initially requested.

    Additionally, it now checks that the redirect has been sent over a secure connection, as recommended by the RFC.

    If an update to the latest version is not possible, I encourage packagers to apply the simplest patch:

    diff --git a/slixmpp/basexmpp.py b/slixmpp/basexmpp.py
    index 5403dd3..ab6f124 100644
    --- a/slixmpp/basexmpp.py
    +++ b/slixmpp/basexmpp.py
    @@ -751,7 +751,6 @@ class BaseXMPP(XMLStream):
                     port = int(port_sec.split(':')[1])
    
                 self.address = (host, port)
    -            self.default_domain = host
                 self.dns_records = None
                 self.reconnect()
    

    This prevents the untrusted domain from being used as a trust anchor, mitigating the issue.

    The issue was found externally by Dickson Wu of CertiK.

    Removals / Deprecations

    • slixmpp.xmlstream.cert has been removed. It was not used anywhere and allows us to drop pyasn1 and pyasn1-modules which means our only mandatory dependency is now aiodns! (and slixmpp can somewhat work without too)
    • xmpp.register_handler() no longer takes an after parameter. It was unused.

    Fixes

    • Fix a crash where an invalid JID sent by the server could create a traceback.
    • Interactions between XEP-0004 (Data Forms) and XEP-0377 (Spam Reporting) prevented users from adding multiple reports to the form, which crashed.
    • XEP-0050 (Ad-Hoc Commands) sessions are cleaned more thoroughly.
    • XEP-0050 (Ad-Hoc commands) returns the correct error when a session is not found.
    • XEP-0492 (Chat Notification Settings) had a slight schema definition bug.
    • Stanza matchers for XEP-0313 (Message Archive Management) were not unregistered after the queries, creating a drag on performance over time.

    Features / Improvements

    • XEP-0363 (HTTP Upload)’s upload_file() can now take an ifrom parameter, to upload from a component.
    • Performance improvement: the MatchIdSender matcher is now much more efficient.
    • register_plugins() can now take an exclude set, to register all plugins except a few.
    • XEP-0444 (Message Reactions)’s send_reactions can now take mfrom and mtype parameters, to choose the origin JID and message type.
    • XEP-0410 (MUC Self-Ping) now has a targeted event (muc::room@jid::ping_changed) as well as the generic one.
    • XEP-0513 (Intentional Mention Markup) has been updated to v0.1.1.
    • XEP-0106 (JID escaping) has been updated to unescape nodes as well.
    • The "scheduler" example in the docs is no longer empty.
    • pyo3 has been updated to 0.30.0.

    Links

    You can find the new release on codeberg, pypi, or the distributions that package it in a short while.

    Previous version: 1.17.0.