BugTraq
CVE-2016-1519: GrandStream Android VoIP App TLS MitM Vulnerability Mar 17 2016 12:16PM
Georg Lukas (lukas rt-solutions de)
CVE-2016-1519: GrandStream Android VoIP App TLS MitM Vulnerability
==================================================================

Affected app: [Grandstream Wave][GSWAVE] version 1.0.1.26 (and probably
earlier)

Classification: [CWE-295 Improper Certificate Validation][CWE295]

## Summary

The Grandstream VoIP products deploy a remote provisioning mechanism that
allows to automatically set configuration elements on app startup. By
default, an insecure connection to `fm.grandstream.com` is used to obtain
the
provisioning profile ([CVE-2016-1518][CVE-2016-1518]). However, even if an
HTTPS URL is
configured, the certificate is not validated, allowing an active attacker to
successfully impersonate the provisioning server with an invalid,
mismatching
or outdated certificate. Based on that, the attacker can elevate
[CVE-2016-1518][CVE-2016-1518]
to redirect phone calls through a malicious server, or turn the phone into a
bug. The changes are stored locally, so a single successful
attack is sufficient to gain permanent control of the app.

## Details

When accessing HTTP/HTTPS URLs, the Grandstream Wave app is using a custom
HTTP connection manager in the `com.softphone.common` package. That class is
deploying both a custom [TrustManager][TM] and a custom
[HostnameVerifier][HV]
(the depicted variable and class names have been changed as part of the
deobfuscation):

private static TrustManager[] tm = new TrustManager[]{ new TM(null)
};
private static HostnameVerifier hv = new HV();

...

SSLContext sc = SSLContext.getInstance("SSL");
sc.init(null, tm, new SecureRandom());

HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
HttpsURLConnection.setDefaultHostnameVerifier(hv);

The custom TrustManager skips all verification, essentially accepting any
certificate for any connection:

class TM implements X509TrustManager {
public void checkClientTrusted(X509Certificate[] c, String
at) {}
public void checkServerTrusted(X509Certificate[] c, String
at) {}
public X509Certificate[] getAcceptedIssuers() {
return new X509Certificate[0];
}
}

The custom HostnameVerifier does not verify if the server certificate
corresponds to the hostname the connection was made to, allowing to present
the client with a certificate issued for a different hostname:

class HV implements HostnameVerifier {
public boolean verify(String hostname, SSLSession session) {
/* skipped log output */
return true;
}
}

Each of these two issues individually allow an active MitM attacker (e.g. in
a
public WiFi network) to hijack the connection, either by presenting a
self-signed certificate or by presenting a valid certificate issued to an
attacker-controlled domain.

## Impact

Even if the app is configured to use HTTPS for the provisioning server, an
active attacker can trick it into obtaining a provisioning file from an
attacker-controlled sserver, and thus to leverage
[CVE-2016-1518][CVE-2016-1518]:

* Adding or replacing VoIP accounts / servers
* Turning the phone into a bug by setting a "silent" ringtone and enabling
auto-answer
* Changing the Config Server Path URL to a server controlled by the
attacker,
allowing to push new configuration after the initial Man-in-the-Middle
attack

## Mitigation

On the Wave app, the only way to close the issue is by disabling remote
provisioning. This can be achieved by entering an empty URL:

1. Open "GSWave"
2. Switch to the "Settings" tab
3. Open "Advanced Settings" menu
4. Set "Config Server Path" to an empty string

After disabling / securing the auto-provisioning, **all configuration
elements** should be checked for prior manipulation, e.g. by exporting and
inspecting the configuration file.

## Timeline

* 2015-11-24 Discovery of the issue
* 2015-11-25 Requested CVE number
* 2015-12-01 Notification of vendor
* 2016-01-20 CVE number assigned
* 2016-03-16 Public disclosure

## Contact

Please contact Dr. Georg Lukas with any further questions regarding this
vulnerability.

PDF version:
http://rt-solutions.de/images/PDFs/Veroeffentlichungen/CVE-2016-1519-gsw
ave-
tls-mitm.pdf
[CVE-2016-1518]:
http://rt-solutions.de/images/PDFs/Veroeffentlichungen/CVE-2016-1518-ins
ecur
e-provisioning.pdf
[GSWAVE]: https://play.google.com/store/apps/details?id=com.softphone
[TM]:
http://developer.android.com/reference/javax/net/ssl/X509TrustManager.ht
ml
[HV]:
http://developer.android.com/reference/javax/net/ssl/HostnameVerifier.ht
ml
[CWE295]: https://cwe.mitre.org/data/definitions/295.html

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

Tel. : (+49)221 93724 16
Fax : (+49)221 93724 50
Mobil: (+49)179 4176591
Web : www.rt-solutions.de
rt-solutions.de
experts you can trust.

Sitz der Gesellschaft: Köln
Eingetragen beim Amtsgericht Köln: HRB 52645
Geschäftsführer: Prof. Dr. Ralf Schumann, Dr. Stefan Schemmer

0? *?H?÷
 ?0?1 0 +0? *?H?÷
 ?20?60? 0
 *?H?÷
0o1 0 USE10U
 AddTrust AB1&0$U AddTrust External TTP Network1"0 UAddTrust External CA Root0
000530104838Z
200530104838Z0o1 0 USE10U
 AddTrust AB1&0$U AddTrust External TTP Network1"0 UAddTrust External CA Root0?"0
 *?H?÷
?0?
?·÷3æò-9àN[í¼l͵ú#¶ÎÞ?3?¤)L}??½J¼?íãÏåmPZÖ?)?Z?°IzÛ.?ý¸Ê¿78-
>?A­pVÇðO?è2?tÊȐTéÆ_x?@<¬aª^??¡jPÜ×?N¯³¦q??q³P`
ǝ8?¨é¨i&«L°O#«:O?ØßÎ?áio»×B×kDäÇ­îmA_rZq7³ye¤Y ?7÷/
Â?rÚÐ8rÛ¨EÄ]*}·´ÖÄî¬ÍD·É+ÝC%úa¹ijX#·§3VuYõÍ)×F·
+e¶ÓBo²¸{ûïé]SÕ4Z'£Ü0Ù0U­½?z4´&÷úÄ&Tï½à$ËT0 U
0Uÿ0ÿ0?U#?0??­½?z4´&÷úÄ&Tï½à$ËT¡s¤q0o1 0 USE10U
 AddTrust AB1&0$U AddTrust External TTP Network1"0 UAddTrust External CA Root?0
 *?H?÷
?°?à?%ÂÖ#â??A??Ù?yÙ[#6e°Øw»¬AlG`?Q°ù2=çüö&Ç?¥¿Zü?Ïxy?!?
âL
?5¼òÞQÄÒ?·Ü~Nîpý9ë Q-?½àÁßFuç$­ìôB´??pgº5JÓ+zÌQB¡zcÑ满Å+Â6¾
æ½c~y{§
@«jݏ?Ãöö?BQÔEõ?§b!h C<?ç|½$Ø©?s??V18´q?ÍÈ??.á???Ë1ñDLÆsIv`Çø½?k.éÌLZ?y
.Õ?c&U??Ø?Z{мǏN?0?¯0?? à#Ë?S?­anzTgk!0
 *?H?÷
 0o1 0 USE10U
 AddTrust AB1&0$U AddTrust External TTP Network1"0 UAddTrust External CA Root0
141222000000Z
200530104838Z0?1 0 UGB10UGreater Manchester10USalford10U
COMODO CA Limited1A0?U8COMODO SHA-256 Client Authentication and Secure Email CA0?"0
 *?H?÷
?0?
??±
ÚzSNpR¼V¦&·¸Ià?çQ«ñðZI£´?`¼zQB§y?¤"ßaN?Õv#
ÓJ¶ ?n¥=Ùº»þ¡?©.CRC|¯2PȦOZéØÏ?%?{?è0dæ¤øV?ý*$3?¬Dåi?£FKÂ3Ôé@?°±¬?@¹
µ?:?*S£Û= a<U?ÙNv%!)ú£|qvOîá_éûT?ÛÃ{5R·?Þ"=,0-1Y½R7°3i-CëúÖ¥ñ?wgQ?Ùî'ë¼¥8v?¤©
8ÿß?õ¬I¾Ê÷s?:2«??:=F:WtaP¾Æ@?Ëäâ?¢!£?0?0U#0?­½?z4´&÷
úÄ&Tï½à$ËT0U?ak?ᢠªOìgñ£÷´?Áì0Uÿ?0Uÿ0
ÿ0U%0++0U 
00U 0DU=0;09 7 5?3http://crl.usertrust.com/AddTrustExternalCARoot.crl05
+)0'0%+0?http://ocsp.usertrust.com0
 *?H?÷
 ?*n¬UÁ:«?ÅØíÍUóªka+À #?Åfjo±õ´µw^aß}þ³¤??üû[jr
A¼ºÁXÕ&ÂêÕM?ûþ??ÏXã"c?Rø»6«}X¥Þ«;cåÚÕsïìàû{â£ÿðB#?ʶM>äK²¨-ÔØ»BKi
?Û¦74è{à¥?Ê:Ç?O?4n?eÐ?»©ÜÊÊ6ÑôüÂd)5¯Ö±§qÒC±>?ì?2Sôv?Ê?4¹,ÊæJØ?
Á?â?ûZBj#!éeÇõÕ»~ê?? bêÑ:,YÅ?3ò8?å¶ézyöJ&ú|?û?0?A0?) ~ ò¿nÓiBA_¿n:)0
 *?H?÷
 0?1 0 UGB10UGreater Manchester10USalford10U
COMODO CA Limited1A0?U8COMODO SHA-256 Client Authentication and Secure Email CA0
160218000000Z
170217235959Z0&1$0" *?H?÷
 lukas (at) rt-solutions (dot) de0 [email concealed]?"0
 *?H?÷
?0?
?°Ï=fmQ»?? þù?s¤ ¿g<KS5¾}? ¯Eï³Ð?}ûõyPÀ#¶
xâóyØ/¥´?5+j"?Ù¬çý\öÈ0È2ÔIéz?¯}É¥eÀÚ_#dwpxCòTQQ??fµ£ã?eq?b®
ö81 Ih9!¸¾S?µª]½¬TRºw ôòá;T¶ß$Ôï32U?=}õÛ0f???Þ½8ÑXl~ô?­Y r¿Ø?ÛÙÅ'ä$ç®?¼Pa??!¾9ºë6?ü?Ê!¢2Ñ-ÿ9lg$U^³??bÅ4HR7?`¡ÆäãS?A.çíì??
£?ó0?ï0U#0??ak?ᢠªOìgñ£÷´?Áì0U9m3eðÑ°¥#>c[Ü?¦??«?
?0Uÿ 0 Uÿ00 U%0+ +²10 `?H?øB 0FU ?0=0; +²10+0)+https://secure.comodo.net/CPS0]UV0T0R P
 N?Lhttp://crl.comodoca.com/COMODOSHA256ClientAuthenticationandSecureEma
ilCA.crl0+?0?0X+0?Lhttp://crt.comodoca.com/COMODOS
HA256ClientAuthenticationandSecureEmailCA.crt0$+0?http://ocsp.c
omodoca.com0 U0lukas (at) rt-solutions (dot) de0 [email concealed]
 *?H?÷
 ?!ϲÖ;?4¬©£ ѹ×.u±]
îÝ?÷µß¾´85k9.¤¢[Ý??ssØ?÷@?ü0ÃÜÔ?ÃqÌ?°â?!LR®ïÖô®8µÅíjsÓM.3?0¹I³¼na-
hùÞxÖÇñÞl2¼]5¨6d}CcÓb¬±?ÌSB+ø?8)O§²{æ¯)fÀãľ<úýÝàVfª5ØK¢InX,µ0JËà
?5võm'Õ»ÚcõdÛª4lÂ$9¼néÎl¿?¥?sF?Xkܸó?²h?ΪÁýw«å"È?ÀØ??/×PMÐ
ªrD<d¤Ò×?È\e7?n1?Y0?U0°0?1 0 UGB10UGreater Manchester10USalford10U
COMODO CA Limited1A0?U8COMODO SHA-256 Client Authentication and Secure Email CA~ ò¿nÓiBA_¿n:)0 + ?}0 *?H?÷
 1  *?H?÷
0 *?H?÷
 1
160317121619Z0# *?H?÷
 1èÁ»/BûXW+?Ð_ÿ]rJ0? *?H?÷
 1?0?0  `?He*0  `?He0
*?H?÷
0  `?He0*?H?÷
?0
*?H?÷
@0+0  `?He0  `?He0  `?He0Á +?71³0°0?1 0 UGB10UGreater Manchester10USalford10U
COMODO CA Limited1A0?U8COMODO SHA-256 Client Authentication and Secure Email CA~ ò¿nÓiBA_¿n:)0Ã *?H?÷
  1³ °0?1 0 UGB10UGreater Manchester10USalford10U
COMODO CA Limited1A0?U8COMODO SHA-256 Client Authentication and Secure Email CA~ ò¿nÓiBA_¿n:)0
 *?H?÷
?5§¬8pÆ ÄÄ@ì?X'ê4åQ?¡Å:Å5kßóô¯VlC+¥Ê-ë? ÈgÌÜFkB²=ÇÁ??¦~tì??f?êg¢¢òÈ{CõãÛÚá»þèO?Í?FK >B *wÁ9´¶¸à*Õ???" Òo?#S( (Ð?. :ï??¥w==_Gþ®ÔdêзÛ?ÔÛep~x¹ ?Å©û?-?Â?.=äèF8U^;"Ïì?p§íÌÀóZG?YÜã-_??
ôFy)Éå?£©-F"¸N^ì0?êjùb]ß?1y¨ÅA+?Äóø? ?Õl:îM­|TÉ¢

[ reply ]


 

Privacy Statement
Copyright 2010, SecurityFocus