Re: [xmpp] IQ Handling vulnerabilities

Thijs Alkemade <> Tue, 11 February 2014 15:31 UTC

Return-Path: <>
Received: from localhost ( []) by (Postfix) with ESMTP id 5BC521A0564 for <>; Tue, 11 Feb 2014 07:31:54 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: 0.948
X-Spam-Status: No, score=0.948 tagged_above=-999 required=5 tests=[BAYES_05=-0.5, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HELO_EQ_NL=0.55, HOST_EQ_NL=1.545, LOTS_OF_MONEY=0.001, RP_MATCHES_RCVD=-0.548] autolearn=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id NWGgSvdhSMlm for <>; Tue, 11 Feb 2014 07:31:52 -0800 (PST)
Received: from ( []) by (Postfix) with ESMTP id BEDEF1A05E0 for <>; Tue, 11 Feb 2014 07:31:51 -0800 (PST)
Received: from [] ( []) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPSA id 2093C247FD; Tue, 11 Feb 2014 16:31:38 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;; s=mail; t=1392132701; bh=xOwuL2olihdo6N1z4F341UvH1MkMs5RBjvIOvqIY098=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=Psw7MUHFqr3Nw4CoSRZGs+wkpoumnHNhXZgvtUPGty+XyegrHasP/YkI2c6SP/xVa l3z7bBLs0ltKJqRvtgPv+lWNPn3aLlQc+oO2aTzHvS+L3cL62wu+Cj3q/mI7W0d/Jv wkXSh5Cjdf10NKDayrO0Q+Yd6LVfyBVgnr/y85hE=
Content-Type: multipart/signed; boundary="Apple-Mail=_D329E652-F036-4921-B5DF-FAD94442C96F"; protocol="application/pgp-signature"; micalg=pgp-sha1
Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\))
From: Thijs Alkemade <>
In-Reply-To: <>
Date: Tue, 11 Feb 2014 16:33:26 +0100
Message-Id: <>
References: <> <> <> <> <> <> <> <> <> <> <> <>
To: Alexander Holler <>
X-Mailer: Apple Mail (2.1827)
Cc: XMPP Working Group <>
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: Tue, 11 Feb 2014 15:31:54 -0000

On 11 feb. 2014, at 16:14, Alexander Holler <> wrote:

> Am 11.02.2014 13:29, schrieb Dave Cridland:
>> On Tue, Feb 11, 2014 at 12:23 PM, Alexander Holler <>wrote;wrote:
>>> Hmm, in all these mails it was never be mentioned that IDs still have to
>>> be unique over some time for one session. I'm not sure if such is given
>>> with the above constructs. It might be very unlikely that the same ID will
>>> appear twice, but someone has to take a deeper look at it when using such
>>> constructs like above. Of course, in reality the window in time IDs must be
>>> unique is rather small, but ...
>> You'd need random collisions amongst cryptographically secure hashes.
>> You're pretty safe.
> I don't aggree. You are safe if you use the hash as intendend, but not
> if you just use some part of the hash(-number) or hashes of hashes. I'm
> not sure about how safe it is (in regard to collisions) if you look at
> consequent hashes of hashes. I would assume that is not what
> cryptographers do look for (primarily).
> At least I can't remember to have seen some discussion if the series of
> hash(hash(hash(...))) is collision free (that is imho quiet different
> than hash(random); hash(random)). Of course, I'm not looking that often
> at cryptographic papers, I usually prefer if cryptographers do such. ;)

You're not going to stumble upon a SHA-1 collision by accident. Even if you do
"hashes of hashes". The esitmated cost of an intentional SHA-1 collision is
still at least $1M:

If you do happen to find one, congratulations, you are now famous. Nobody has
published a SHA-1 collision yet.

Collisions in 'id's is also not very relevant. In any XMPP client, there will
be a finite list of 'id's for which it still expects a reply (outstanding
queries, unacked messages). Checking against each of those is trivial.