Re: [xmpp] IQ Handling vulnerabilities

Alexander Holler <> Fri, 07 February 2014 11:23 UTC

Return-Path: <>
Received: from localhost ( []) by (Postfix) with ESMTP id 4E4D31A0369 for <>; Fri, 7 Feb 2014 03:23:37 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: 0.208
X-Spam-Status: No, score=0.208 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HELO_EQ_DE=0.35, HELO_MISMATCH_DE=1.448, HOST_MISMATCH_NET=0.311, SPF_PASS=-0.001] autolearn=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id I6hQ0K1NtVqu for <>; Fri, 7 Feb 2014 03:23:35 -0800 (PST)
Received: from ( []) by (Postfix) with ESMTP id 84F011A0033 for <>; Fri, 7 Feb 2014 03:23:35 -0800 (PST)
Received: by (Postfix, from userid 65534) id 39A34423C2A6; Fri, 7 Feb 2014 12:23:34 +0100 (CET)
Received: from eiche.ahsoftware ( []) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPSA id 33756423C256 for <>; Fri, 7 Feb 2014 12:23:33 +0100 (CET)
Received: by eiche.ahsoftware (Postfix, from userid 65534) id 54BF980378; Fri, 7 Feb 2014 12:23:31 +0100 (CET)
Received: from krabat.ahsoftware (unknown [IPv6:feee::5246:5dff:fe8b:95f8]) by eiche.ahsoftware (Postfix) with ESMTP id 4977C7FA6C for <>; Fri, 7 Feb 2014 11:23:25 +0000 (UTC)
Message-ID: <>
Date: Fri, 07 Feb 2014 12:23:24 +0100
From: Alexander Holler <>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0
MIME-Version: 1.0
To: XMPP Working Group <>
References: <>
In-Reply-To: <>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Subject: Re: [xmpp] IQ Handling vulnerabilities
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: XMPP Working Group <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Fri, 07 Feb 2014 11:23:37 -0000

Am 06.02.2014 12:26, schrieb Kevin Smith:
> Hi folks,
>    Discussion in the XSF and at the recent XMPP Summit has shown that
> there are widespread issues with handling of iq responses in XMPP
> software. This is probably something we need to consider handling.
> The basis of this is that many libraries/clients
> a) Only check the id of an iq error/result, not the sender, to check
> it matches one they've sent (Very Wrong)
> b) Use predictably generated ids for stanzas (ill-advised, but not
> strictly wrong)
> c) Use known resource strings (bad, but not strictly wrong)

Just to make it clear, the real problem here is neither the IDs nor the 
resources, but not checking the sender of the reply.

If the sender would be checked, random IDs would only protect against 
sniffing/injecting packets into a stream or against malicious servers. 
The first (sniffing/injecting) is already protected by using encryption 
and the second (malicious servers) doesn't make much sense at all, 
because a client has to trust it's server.

One of the reasons why clients don't check the sender part seems to be 
that it wasn't clear what the sender of a reply is, if the IQ query was 
without an explicit 'to' attribute.

A simple rule for clients could be to check that the JID of IQ replies 
where the origin should be the connected server is either the JID of the 
server (no node, no resource) or the received bare JID (stripping a 
possible resource) is the bare JID of the client.


Alexander Holler