BugTraq
CVE-2014-5075 MitM Vulnerability in the Smack XMPP Library for Java Aug 05 2014 05:31PM
Georg Lukas (lukas rt-solutions de)
CVE-2014-5075 MitM Vulnerability in the Smack XMPP Library for Java
===================================================================

Smack <http://www.igniterealtime.org/projects/smack/> is an Open Source
XMPP (Jabber) client library for instant messaging and presence written
in Java. Smack prior to version 4.0.2 is vulnerable to TLS
Man-in-the-Middle attacks, as it fails to check if the server
certificate matches the hostname of the connection.

Affected versions
-----------------

- Smack 4.0.0 and 4.0.1 are vulnerable.
- Smack 2.x and 3.x are vulnerable if a custom `SSLContext` is
supplied via `connectionConfiguration.setCustomSSLContext()`.

Details
-------

Smack is using Java's `SSLSocket`, which checks the peer certificate
using an `X509TrustManager`, but does not perform hostname verification.
Therefore, it is possible to redirect the traffic between a Smack-using
application and a legitimate XMPP server through the attacker's server,
merely by providing a valid certificate for a domain under the
attacker's control.

In Smack versions 2.2.0 to 3.4.1, a custom `ServerTrustManager`
implementation was used, which was supplied with the connection's server
name, and performed hostname verification. However, it failed to verify
the basicConstraints and nameConstraints of the certificate chain
(CVE-2014-0363, http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-0363)
and has been removed in Smack 4.0.0.

Applications using Smack 2.2.0 to 3.4.1 with a custom `TrustManager` did
not benefit from `ServerTrustManager` and are vulnerable as well, unless
their own `TrustManager` implementation explicitly performs hostname
verification.

Mitigation
----------

Users of the Smack library are advised to upgrade to Smack 4.0.2, and
then use `connectionConfiguration.setHostnameVerifier()` with a
reasonable `HostnameVerifier` implementation. A proper hostname verifier
**MUST** be configured to close the vulnerability.

For Smack 3.x users, a backported commit has been created:

https://github.com/ge0rg/smack/commit/8d483b25bda7ae86a3f3e83217c2add6d7
10798a

Here, a `HostnameVerifier` implementation needs to be
supplied via `connectionConfiguration.setHostnameVerifier()` as well.

When using the official JRE, the internal class
`sun.security.util.HostnameChecker` can be wrapped as described
here:

http://kevinlocke.name/bits/2012/10/03/ssl-certificate-verification-in-d
ispatch-and-asynchttpclient/

If Apache's HttpClient library is available, its `StrictHostnameVerifier` can
be used.

On Android, MemorizingTrustManager provides both certificate checking and
hostname verification with interactive fallback, allowing the user to decide
about the trustworthiness of a server:

https://github.com/ge0rg/MemorizingTrustManager/

Affected Applications
---------------------

Smack is a library used by different applications. Therefore, the
authors of the following Smack-based applications have been contacted to
coordinate updated releases:

- ChatSecure (fixed in 13.2.0-beta1)
- GTalkSMS (contacted on 2014-07-28)
- MAXS (fixed in 0.0.1.18)
- yaxim and Bruno (fixed in 0.8.8)
- *undisclosed Android application* (contacted on 2014-07-21)

The following Smack-based applications were not affected:

- TransVerse (special interest client)
- Xabber (using a custom `TrustManager` performing hostname verification)

Timeline
--------

- 2014-07-20 Discovery of Smack vulnerability, notification of Smack
maintainer
- 2014-07-21 Notification of vulnerable apps' authors
- 2014-07-27 Release of Smack 4.0.2
- 2014-08-01 Release of MAXS 0.0.1.18
- 2014-08-04 Release of yaxim 0.8.8
- 2014-08-05 Release of ChatSecure 13.2.0 beta 1
- 2014-08-05 Publication of this advisory

Links
-----

Online version of advisory:
http://op-co.de/CVE-2014-5075.html

PDF version:
http://op-co.de/CVE-2014-5075.pdf

--
Dr. Georg Lukas
rt-solutions.de GmbH
Oberländer Ufer 190a
D-50968 Köln

Tel. : (+49)221 93724 0
Fax : (+49)221 93724 50
Mobil: (+49)179 4176591
Web : www.rt-solutions.de

0? *?H?÷
 ?0?10
 `?He0? *?H?÷
 ?[0?0??[uV?T? ϯ8Hα¤0
 *?H?÷
0Ê1 0 UUS10U
VeriSign, Inc.10U VeriSign Trust Network1:08U 1(c) 1999 VeriSign, Inc. - For authorized use only1E0CU<VeriSign Class 1 Public Primary Certification Authority - G30
991001000000Z
360716235959Z0Ê1 0 UUS10U
VeriSign, Inc.10U VeriSign Trust Network1:08U 1(c) 1999 VeriSign, Inc. - For authorized use only1E0CU<VeriSign Class 1 Public Primary Certification Authority - G30?"0
 *?H?÷
?0?
?Ý?Ô¹´ù§Øóx?Þ=ÜlÙzÝ$QfÀÇ&Y
¬Â?Ñ3ð?5nÈÞªnNT'ïÄmì ãðD¥WÇ@X£Gqì`öm?È9íþBVßäLIxNv5c6Ýf¼
6£UhÕ¢6 ¬«!&T­?Êà¬Ê­?âøñà`ÿÂu+LÌÚþ??!êºþ>T×ÒYxÛ<nÏ ¸'¡ä¾g?ʠų?ÝÉu?ë0?_£
ÍÙ®x?#é\Û)½­UÈT?cöè¦êÇ7\£)ÙÛ;´×VGJ¯?'ÑÅX?ÁÝöª§£ÚhªmQá¿ek??vÑ
=0
 *?H?÷
?«f×³ºÇ?¶æUÐñ?1ZªÙªF&qí¥­SVbG*Déþ?t ?¹ôM²Ñ_²¶Ò?\³?ÍËÔ§Ù`??
:øÁ7aÊç°Åå?ÚT¦¬1®?Þͬ¸À??nr¤çi?eÄ?<ýyÔ>Oê÷?ÎÍg|Oeÿ??TsÇÿ6÷?-ìÐ^
Oÿ?rÖ¸ñL
&eâD?Ç?ãÝè
Úì¥ ?ih¡O~ákÏAú??¼8Ý°.±k²BÌ?¼ùH"yJ²> tÙjþò(xVyOmPê°µW±7fX#óÜß
?Äï?Õ8`?£KÞ?q,òÛ¶¤ï?î0?90?! f­©i,@?ÔÅOï´¹g³j0
 *?H?÷
0ù1 0 UDE1)0'U
 Deutscher Sparkassen Verlag GmbH10U VeriSign Trust Network1907U 0Terms of use at https://www.s-trust.de/rpa (c)111503U ,Class 1 Managed PKI Individual Subscriber CA1,0*U#S-TRUST Class 1 CA - Sichere E-Mail0
140217000000Z
160217235959Z0Ç1)0'U
 Deutscher Sparkassen Verlag GmbH10U 
Sichere EMail1F0DU =www.verisign.com/repository/CPS Incorp. by Ref.,LIAB.LTD(c)9610U Georg Lukas1$0" *?H?÷
 lukas (at) rt-solutions (dot) de0 [email concealed]?"0
 *?H?÷
?0?
?é_@Gj!l)é?6k\,ÖÒñ!??׺à0QéµXï\öSv?®ïE"¨s
Ì?¼b??t÷¶?"Þõ\ÔÎ^íé?®?àÙïYjÌ$ÄWjAú~-ûã¯H?Grq¨?uWÛYæÿ8òK2?#¤-?&`
.?ïmuÅ<¬
?Ê]?`?Á¤øÅâÙt
K 
ÅòñuÔWDôÁ¾ìvôzÒù¸Äå6÷?&Òês?M?pÉî;¥)ª
²2 ? |ýÊõP?<¯Ä ÿ*Úv©µ?j/ÃJ?ohÿï¡%/ØÖÐÕ?ý?X-ð?öÆo
ì²¾/OÆïM)f&¾ £ì0é0 U00eU^0\0Z X V?Thttp://onsitecrl.s-trust.de//DeutscherSparkas
senVerlagGmbHSichereEMail/LatestCRL.crl0 U 0BU ;0907 `?H?øE0(0&+https://www.s-trust.de/rpa0 `?H?øB?0
`?H?øE ÿ0
 *?H?÷
?aõªò
nË#½Ý??,ƧW9÷®÷® +?à?S?íÇä1lx/±Øü`.R=4&K)÷» iïAu
¿)51Æ.ÃfÄ\>+Öà:Uw*bJçê%sJÕvÒ1:«ÊͼÍ=Töñ9lɼª? 'Îìb&¯3ü»ÓÕi|uŹ£¸
Oæpÿ×nCXuÿ=?D?ÞD' ¹öËA÷|u/ÿ8^'L©!å-b ¹?VLkL¹?'2é#-øÔ:_-¯iU&
uâséEuzCË ñ¹é:?@Ë?_mÇ_µëe ̽4oçÕÍcõ$}ÎÖ¥4ÈWu?q¹PÑ?g0?s0?[ zÜ5uùH}Ðáeª?Í0
 *?H?÷
0{1 0 UDE1)0'U
 Deutscher Sparkassen Verlag GmbH10U VeriSign Trust Network1 0US-TRUST Class 1 CA - G10
110331000000Z
161231235959Z0ù1 0 UDE1)0'U
 Deutscher Sparkassen Verlag GmbH10U VeriSign Trust Network1907U 0Terms of use at https://www.s-trust.de/rpa (c)111503U ,Class 1 Managed PKI Individual Subscriber CA1,0*U#S-TRUST Class 1 CA - Sichere E-Mail0?"0
 *?H?÷
?0?
?¿MD³~î¤áøCypE ácâøû6K?ñ+ÇãÔêÌ«ãÆA_¹!Åþ%?À×õnx
ü5?B:ýIÚWº÷[¸¡áPï·¾?û!-£âp???««2FmR(3g?à[¾Xi¢?ÅRZÑÊÌ-\?~Çg='ï

??ô[©Þ¶Ógwi¤zõXÊB¶`×=à Ba»?µ­í¾£jn:ÀÞ»C
ßìðj?´e«ú{3?T©V8¶Ô8Úºø°GÈI?u?±´};êO}£ ø¥ªmLQl-?Ó-{B2Á´@@Qº. ?úã??êrµiýÓ4-£?r0?n0Uÿ0ÿ0lU e0c0a `?H?øE0R0&+https://www.s-trust.de/cps0(+
0https://www.s-trust.de/rpa0sUl0j0h f d?bhttp://onsitecrl.s-tru
st.de/offlineCA/DeutscherSparkassenVerlagGmbHSTRUSTClass1CA-G1/LatestCRL
.crl0Uÿ0%U0¤010U
C1C2-1-2048-70UO|-q$¸ªQu0IcCFàXà^0U#0?Þ?OY|± ÷u3=µ
Q#w?j0
 *?H?÷
?m:T DNf{íº(l`
ÙtF]9°o-?XT8ëåâÕà??Yr?ÀxMÿÀ¡¸'²é(»ì?CýÜU?OG?e?ãeÑg{°Àíà?( #î?z~¶P?¿ï×QOâ©d·ÛÓ®g#
?5é'ðE6;ߣ\àÍ×
q?ó¨Õêé¤N?çÝZwßm&Ý%Õ4ÏAÒ;ÒÕuê2
¾?)ݍ¿´g£`bú?}?_uL&¨}Ç=Ã`õÆ=D,C«{?a
?&?w$@þåmêªÔÏÁ@I2èP :µ{???ë|×#J¬Á2³??ô+ªþ?RÝ?|5K¶5´µq?ß¡0??0?m 
\·}5?´??V/ÒÖ¦Ï0
 *?H?÷
0Ê1 0 UUS10U
VeriSign, Inc.10U VeriSign Trust Network1:08U 1(c) 1999 VeriSign, Inc. - For authorized use only1E0CU<VeriSign Class 1 Public Primary Certification Authority - G30
110331000000Z
210330235959Z0{1 0 UDE1)0'U
 Deutscher Sparkassen Verlag GmbH10U VeriSign Trust Network1 0US-TRUST Class 1 CA - G10?"0
 *?H?÷
?0?
?Ôaïïk®ÌNq\cÅ?ßÚbò!?­ã õ7>¾ww?K஡p£¦À.h?¾û394ûò1?<5Þ÷g/ÏDxøHZã9IEÍ>?'¨IË
¬ñnü?bº?äÜø°`#ÌË\À9Æ@cEÿ»kCR?5$7/Èæ?ßE-Åôþ?t§«ÒĶØÆ??/P|hB
Yt¥65êcÍq6·GpÛRhyâ;WwÓLZw?î ÎMG²-o#²?9Þ娠ôc±®aR?~(st?ièÂ?¼?Y/;?ÏF{Ã??õ%eQCÎ õæ¸a¦ý¹ul(X?`?;Kz7
£?³0?¯0Uÿ0ÿ0U 00
 `?H?øE04U-0+0) ' %?#http://crl.verisign.com/pca1-g3.crl0U
ÿ0)U"0 ¤010UAffSCC2-2048-1-540UÞ?OY|± ÷u3=µQ#w?j0ñU#
é0æ¡Ð¤Í0Ê1 0 UUS10U
VeriSign, Inc.10U VeriSign Trust Network1:08U 1(c) 1999 VeriSign, Inc. - For authorized use only1E0CU<VeriSign Class 1 Public Primary Certification Authority - G3??[uV?T? ϯ8Hα¤0
 *?H?÷
?'??LRa?±ö$ÉÔæ?0\®?¡J2={â1¢ÛùByÌ)¡???DqãjmlIÉ?\Ha.@Î?G£ëÐæ^<§
9תD7Kú¨|£?CÒ7K/$??FoË>X?Û¨£Ó¾¾è¼p³(&B?ãG°°r ÉZ¿6Ù%[ç(ôTø5Vx!Õ§?
aH~X6Ðyfg,å9m?ðìéBÐ÷ÆÒ?Õ¦:<?üÏT¾á%É>¶ f?Á[¶ Ϊ;b<WIÕµ} ]¡ªäÑÖª"+?rãmÑ2nd+%å×Þ©?N?N·ÿcW¯ëÒsNÊZ§ý??áõ6°ðjÜih¬01?¢0??0?0
ù1 0 UDE1)0'U
 Deutscher Sparkassen Verlag GmbH10U VeriSign Trust Network1907U 0Terms of use at https://www.s-trust.de/rpa (c)111503U ,Class 1 Managed PKI Individual Subscriber CA1,0*U#S-TRUST Class 1 CA - Sichere E-Mailf­©i,@?ÔÅOï´¹g³j0
 `?He ?c0 *?H?÷
 1  *?H?÷
0 *?H?÷
 1
140805173132Z0/ *?H?÷
 1" ó\1a2¹¡Ô²P²4íÞGù ?àN} . d /0« *?H?÷
 10?0  `?He*0  `?He0
*?H?÷
0  `?He0*?H?÷
?0+0
*?H?÷
@0
*?H?÷
(0  `?He0  `?He0  `?He0+0?! +?71?0?0ù1 0 UDE1)0'U
 Deutscher Sparkassen Verlag GmbH10U VeriSign Trust Network1907U 0Terms of use at https://www.s-trust.de/rpa (c)111503U ,Class 1 Managed PKI Individual Subscriber CA1,0*U#S-TRUST Class 1 CA - Sichere E-Mailf­©i,@?ÔÅOï´¹g³j0?# *?H?÷
  1? ?0ù1 0 UDE1)0'U
 Deutscher Sparkassen Verlag GmbH10U VeriSign Trust Network1907U 0Terms of use at https://www.s-trust.de/rpa (c)111503U ,Class 1 Managed PKI Individual Subscriber CA1,0*U#S-TRUST Class 1 CA - Sichere E-Mailf­©i,@?ÔÅOï´¹g³j0
 *?H?÷
?!%n?6?Sy±qÓ<óÈ÷f?zÜ?§I?«?ØÏ%ÞaÖDRnÍZ}źb?û9ñ'YFyeRÄ @±??4ùï?ór èØû?Á?s?Ƽ®é+ÃìÌ?á??¸a×x?77gkéÒ÷ÌÛûëÉ(ª4Ã??ô¯7
Çé?]f|%}?×6ñ?CG¶?Ö?48x~Á2?Gºã Áë?Îg÷?r{?Kb7æÄx?Å?ôè Õ?p?03¾óè?
Çç±ÉòºGTÓ1ð7Iì?d?ÕøäzHágLG¡÷?Äe? ºþ>ç3IÉèeTp?äGÿ¢ÉC

[ reply ]


 

Privacy Statement
Copyright 2010, SecurityFocus