| Title: | Mac OS X AppleTalk AIOCREGLOCALZN Ioctl Memory Corruption |
|
| Description: | Mac OS X AppleTalk protocol handling code is vulnerable to an exploitable memory corruption issue. This particular vulnerability is caused by failure to validate input data in the AIOCREGLOCALZN ioctl command, and can be abused by unprivileged users by opening an AppleTalk socket and issuing the ioctl control command with a crafted data structure. | |
| Author/Contributor: | LMH <lmh [at] info-pull.com> - discovery, MoKB release, debugging. | |
| References: | ||
| Proof of concept or exploit: |
The following proof of concept / exploit can be used to reproduce the bug
(requires Xcode/GNU GCC compiler to be installed):
MOKB-27-11-2006.c (x86)
gcc MOKB-27-11-2006.c -o MOKB-27-11-2006 && ./MOKB-27-11-2006Note: AppleTalk stack must have been started: sudo appletalk -u en0 |
|
| Debugging information: |
It's been tested on an up-to-date (27-11-2006) Mac OS X installation, running on an Intel "shipping" Mac (x86). alkali:/tmp lmh$ $ gdb /Volumes/KernelDebugKit/mach_kernel -c core-xnu-792.13.8-172.16.0.10-a16a4845 GNU gdb 6.3.50-20050815 (Apple version gdb-573) (Fri Oct 20 15:50:43 GMT 2006) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-apple-darwin"... #0 Debugger (message=0x3c9540 "panic") at /SourceCache/xnu/xnu-792.13.8/osfmk/i386/AT386/model_dep.c:770 Line number 770 out of range; /SourceCache/xnu/xnu-792.13.8/osfmk/i386/AT386/model_dep.c has 312 lines. (gdb) source /Volumes/KernelDebugKit/kgmacros Loading Kernel GDB Macros package. Type "help kgm" for more info. (gdb) paniclog panic(cpu 1 caller 0x001A3135): Unresolved kernel trap (CPU 1, Type 14=page fault), registers: CR0: 0x80010033, CR2: 0x00000000, CR3: 0x00d72000, CR4: 0x000006e0 EAX: 0x00000000, EBX: 0x00000000, ECX: 0x000000f4, EDX: 0x000000f5 CR2: 0x00000000, EBP: 0x00000000, ESI: 0x00000000, EDI: 0x00000000 EFL: 0x00010206, EIP: 0x00000000, CS: 0x00000004, DS: 0x0000000c Backtrace, Format - Frame : Return Address (4 potential args on stack) 0x13ef39d8 : 0x128d1f (0x3c9540 0x13ef39fc 0x131df4 0x0) 0x13ef3a18 : 0x1a3135 (0x3cf1f4 0x1 0xe 0x3cea24) 0x13ef3b28 : 0x19a8d4 (0x13ef3b38 0xf457b9e1 0xe 0x39210048) Backtrace terminated-invalid frame pointer 0x0 Kernel version: Darwin Kernel Version 8.8.1: Mon Sep 25 19:42:00 PDT 2006; root:xnu-792.13.8.obj~1/RELEASE_I386 (gdb) info registers eax 0x0 0 ecx 0x0 0 edx 0x0 0 ebx 0x1 1 esp 0x13ef394c 0x13ef394c ebp 0x13ef39d8 0x13ef39d8 esi 0x1 1 edi 0x1000 4096 eip 0x1a8674 0x1a8674 |