Languages

Showing posts with label DoS. Show all posts
Showing posts with label DoS. Show all posts

Monday, September 2, 2013

The unicode of death! At least for the iPhones...


Maybe you might have been surprised by apps in your iPhone suddenly crashing, or even worse, not nopening anymore!

What happens is that a very cool russian hacker group decided to release on the internet a bug that they found out, a few days before the probable release date for iOS7, september 10th, so that some notionless guys can play with it.

- Link to the original post: http://habrahabr.ru/post/191654/

- Link to the Proof of Concept (do not open if on iOS 6 or Mac OSX mountain lion): https://zhovner.com/tmp/killwebkit.html

What they found out was a sequence of special arabic characters, that applied together with a character that glues the text together and another that inverses it, they can cause a WebKit crash, what means that any app that tries to show this text instantly crashes.

According to the news, Apple had been warned about this bug 6 months ago, what makes it a huge slip on their part not to fix it, after all the iOS 6.1.4 came just to correct a little bug in the lockscreen, but this bug has been published on youtube, instead of quietly warned to them.

Here in Brazil, Cid, a blogger for naosalvo blog did a favor to humanity by posting this code on his twitter calling out for Android users to bomb their iPhone friends with this code in whatever network possible.




Cids calling had an amazing repercursion, with people threatening him, and religious guys saying that he has some pact with the demon, also he got lots of publishing in great newspapers here.

For instance, when this special text is sent via whatsapp, since it appears in the notification area it crashes the springboard immediately (iPhones desktop), and now every time you need to open whatsapp it is going to crash because it will try to show the text, how Nice!

In order to save yourself from this it is necessary to reinstall whatsapp so you can erase your history, according to my cousin Lars he was able to recover part of his history by sending whatsapp data into the iCloud and restoring it afterwards.

In iPhone messages this is even worse, you have to kindly ask your attacker to send another harmless message so you can delete the conversation, or send yourself 50 messages, what will push the history away from the screen.

Now to the technical part, if you are afraid of it you may exit now

I decided to spend some time looking at the crash logs and trying to find out what causes this crash, in my opinion, what have been noticed throughout the internet is wrong! This is not caused by coretext, and I can explain why, take a look at this log from my whatsapp:

Exception Type:  EXC_CRASH (SIGSEGV)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Crashed Thread:  1

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0:
0   WebCore                        0x37c298fc 0x379a7000 + 2631932
1   WebCore                        0x37c2690a 0x379a7000 + 2619658
2   WebCore                        0x37c267be 0x379a7000 + 2619326
3   WebCore                        0x37c2a93c 0x379a7000 + 2636092
4   WebCore                        0x37c2a810 0x379a7000 + 2635792
5   WebCore                        0x379ac7c4 0x379a7000 + 22468
6   WebCore                        0x37dd1e98 0x379a7000 + 4370072
7   WebKit                         0x382dab84 0x382d7000 + 15236
8   WebKit                         0x382da5c0 0x382d7000 + 13760
9   WebKit                         0x382da2ec 0x382d7000 + 13036
10  WebKit                         0x382da28a 0x382d7000 + 12938
11  WebKit                         0x382da22a 0x382d7000 + 12842
12  UIKit                          0x33875964 0x33866000 + 63844
13  UIKit                          0x338758a0 0x33866000 + 63648
14  UIKit                          0x338b1328 0x33866000 + 308008
15  UIKit                          0x33874c52 0x33866000 + 60498
16  UIKit                          0x33873a1e 0x33866000 + 55838
17  UIKit                          0x33873858 0x33866000 + 55384
18  UIKit                          0x33872d18 0x33866000 + 52504

It seems clear to me that this crash came from the WebKit instead of the CoreText as people have been saying (I know why, one says and others that do not understand publish)

Come on think with me here, WebKit is open source, the guy can read the code there until he finds the flaw, but in CoreText the guy has to debug assembler shit in order to find a bug, what seems to you the way they found it?!?

I was able to trace the bug to this file in WebKit:
Specifically this function:
adjustGlyphsAndAdvances()

It is possibly already fixed in this recent version of WebKit, because both iOS7 and OSX Mavericks are not affected by this bug.

And here is a lesson for Apple, they thought everything was going to be ok until iOS7 was released, think again, bugs exist to be fixed, especially critical bugs that lead to a DoS (Denial of Service)

EDIT:

For people in Androids to use this, it is better to copy the text from Cids twitter or this one: http://pastebin.com/raw.php?i=AEF3b444

O Unicode da morte! Pelo menos nos iPhones...

Talvez você tenha sido surpreendido por aplicativos do seu iPhone fechado subitamente, ou até pior, fechando e nunca mais querendo abrir!

O que acontece é que um grupo de hackers russos muito legais resolveram soltar na net um bug que eles descobriram, alguns dias antes do provável lançamento do iOS7, dia 10 de setembro, para que uns sem noção possam brincar disso felizes.

- Link para o post original: http://habrahabr.ru/post/191654/

- Link para a prova de conceito (não acesse se estiver no iOS 6 ou um Mac Osx mountain lion): https://zhovner.com/tmp/killwebkit.html

O que eles descobriram foi uma seqüência de caracteres especiais árabes, que juntos com um caractere de inverter o texto e junto com um outro de aglomerar ele fazem o WebKit travar, ou seja, qualquer aplicativo que tentar mostrar esse texto trava e fecha na hora!

De acordo com notícias, a Apple já haveria sido avisada desse bug a uns 6 meses, o que torna um belo vacilo da parte deles não corrigir logo, afinal o iOS 6.1.4 veio pra corrigir uma besteira na lockscreen, so que essa besteira foi publicada no YouTube ao invés de quietamente avisada...

No Brasil o Cid, blogueiro do naosalvo fez um favor a humanidade maior ainda postando o código no Twitter dele e convocando os usuários do Android a bombardearem seus amigos com iPhone desse código em tudo que é rede.


A convocação do Cid teve uma repercussão incrível, com pessoas ameaçando processar ele, evangélicos se doendo e dizendo que ele tem pacto com o demônio e diversas publicações em jornais de grande circulação.

Quando esse texto especial é enviado pelo whatsapp, como ele aparece nas notificações isso imediatamente trava o springboard e reinicia ele (o desktop do iPhone), e agora toda vez que você tentar abrir o whatsapp ele ira travar, pois vai tentar mostrar o texto. Olha q legal!

Para se salvar disso é necessário reinstalar o whatsapp o que apagara seu histórico, de acordo com meu primo Lars parte do histórico dele ele conseguiu recuperar jogando os dados do whatsapp para o iCloud e depois restaurando após reinstalar.
Nas mensagens do iPhone isso é pior, vc tem que pedir ou pro malfeitor te mandar uma mensagem ou você mesmo te mandar umas 50 mensagens inofensivas, o que empurrará o histórico para fora da tela.

Agora vem a parte da analise técnica, quem tem medo disso pode sair agora
Eu resolvi perder algum tempo olhando pros crash logs e tentando descobrir o que motiva esse travamento, na minha opinião o que vem sendo noticiado na internet está errado! Não é por causa do coretext, e eu explico o porquê, da uma olhada nesse log que saiu do meu whatsapp:

Exception Type:  EXC_CRASH (SIGSEGV)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Crashed Thread:  1

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0:
0   WebCore                        0x37c298fc 0x379a7000 + 2631932
1   WebCore                        0x37c2690a 0x379a7000 + 2619658
2   WebCore                        0x37c267be 0x379a7000 + 2619326
3   WebCore                        0x37c2a93c 0x379a7000 + 2636092
4   WebCore                        0x37c2a810 0x379a7000 + 2635792
5   WebCore                        0x379ac7c4 0x379a7000 + 22468
6   WebCore                        0x37dd1e98 0x379a7000 + 4370072
7   WebKit                         0x382dab84 0x382d7000 + 15236
8   WebKit                         0x382da5c0 0x382d7000 + 13760
9   WebKit                         0x382da2ec 0x382d7000 + 13036
10  WebKit                         0x382da28a 0x382d7000 + 12938
11  WebKit                         0x382da22a 0x382d7000 + 12842
12  UIKit                          0x33875964 0x33866000 + 63844
13  UIKit                          0x338758a0 0x33866000 + 63648
14  UIKit                          0x338b1328 0x33866000 + 308008
15  UIKit                          0x33874c52 0x33866000 + 60498
16  UIKit                          0x33873a1e 0x33866000 + 55838
17  UIKit                          0x33873858 0x33866000 + 55384
18  UIKit                          0x33872d18 0x33866000 + 52504

Para mim ficou claro que o crash veio do WebKit e não do CoreText como o pessoal vem dizendo (e eu até sei porquê, um fala e os outros que não entendem divulgam).

Pensa bem, o WebKit é open source, o cara tem o código fonte lá de frente pra ele e pode ler até achar uma falha, já o core text o camarada tem que debugar a parada em assembler, qual te parece a forma que descobriram esse bug?!?

Pois é, a fonte desse bug consegui rastrear ate esse arquivo do WebKit:
Especificamente nessa função:
adjustGlyphsAndAdvances()

Possivelmente ele já esta arrumado nessa versão atual do WebKit porque o ios7 beta não é afetado pelo bug, bem como o osx mavericks.

Aqui fica uma lição para a apple pelo menos, eles acharam que ia ficar tudo tranquilo até sair o ios7, pensem denovo, bugs são feito para serem arrumados, principalmente bugs críticos como esse que correm risco de DoS (negação de serviço)

EDIT:

O facebook bloqueou posts com este código:


percebi que para o pessoal do android, fica melhor se copiar o texto do twitter do Cid ou esse aqui, caso queiram usar: http://pastebin.com/raw.php?i=AEF3b444

Algumas idéias legais para usar esse código (coloque suas idéias nos comentários):

- Colocar no SSID da sua rede wifi, ninguém irá conseguir conectar em nada ao redor
- Mandar por mensagem para todos seus amigos
- Postar no twitter, todo mundo que te segue não conseguirá abrir o twitter
- Colocar no seu status do whatsapp.