exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Apple libc Incomplete Fix

Apple libc Incomplete Fix
Posted Aug 26, 2016
Authored by Maksymilian Arciemowicz

Apple's libc security update for OS X El Capitan version 10.11.2 has an incomplete fix.

tags | advisory
systems | apple, osx
advisories | CVE-2015-7038, CVE-2015-7039
SHA-256 | 1e5f9c6d0b83d92011bbf4e96ebccd3cac5637b6b7ee38f795eecf2e67ee7819

Apple libc Incomplete Fix

Change Mirror Download
--------------------------------------------------------------------------------
Apple libc incomplete fix of Security Update for OS X El Capitan 10.11.2
Credit: Maksymilian Arciemowicz from CXSECURITY.COM
URL: https://cxsecurity.com/issue/WLB-2016080232
--------------------------------------------------------------------------------

Apple tried to fix security issue in file system (FTS) libc implementation but doesn't patch it completely. Let's back to the security advisory

https://support.apple.com/en-us/HT205637
----------------------------------------
libc
Available for: OS X El Capitan v10.11 and v10.11.1
Impact: Processing a maliciously crafted package may lead to arbitrary code execution
Description: Multiple buffer overflows existed in the C standard library. These issues were addressed through improved bounds checking.
CVE-ID
CVE-2015-7038
CVE-2015-7039 : Maksymilian Arciemowicz (CXSECURITY.COM)
----------------------------------------

it's only one part of reported weaknesses what should be fix by Apple. They fixed multiple buffer overflow but not all out of memory read. Improper security implementation of file system may lead to a few kinds of attacks



--------------------------------------------------------------------------------
1. AV Tools and file system deep directory
The first weakness what Apple should repair is ability of hiding malicious code in external/internal media drive or DMG package. Many AV tools will skip files located in directory deeper then 1024 levels, so it could be used to hide malware by attacker during classic AV scanning. I contacted with one of vendors and they indicate Apple as responsible for repair this bug. To show this issue in practice, you can compare the two DMG files. One is with content of exploits from metasploit in directory located in 1024 level of directory tree

DMG mounted and threats detected by AVG, ESET, Norton AV during folder scanning mode
https://cxsecurity.com/exploits/mac10116expl/10116metaExploits.dmg

The same content but in deep file hierarchy 1024 directories. Classic directory scanning by AV tool couldn't detect the threats.
https://cxsecurity.com/exploits/mac10116expl/10116hideContents.dmg



--------------------------------------------------------------------------------
2. Out of memory reading in libc
The next issue recognised in the latest MacOSX is out-of-bounds read. Apple tried fix all buffer overflows but it looks like that's not all. In Apple code there is still a few weak points of memory management. For example 'ls' and 'find' command and Apple's libc. To easier explain this weakness (CWE-125) let's use this special crafted DMG with deep file system.

$ wget https://cxsecurity.com/exploits/mac10116expl/10116outofread.dmg
..
$ hdiutil attach 10116outofread.dmg
..
$ valgrind ls -laR /Volumes/PoC1_CXSECURITY >>/dev/null
..
==5687== Invalid read of size 1
==5687== at 0x1000116BF: strlen (in /usr/local/Cellar/valgrind/3.11.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so)
==5687== by 0x100323A4B: __vfprintf (in /usr/lib/system/libsystem_c.dylib)
==5687== by 0x10034C6C0: __v2printf (in /usr/lib/system/libsystem_c.dylib)
==5687== by 0x100322381: vfprintf_l (in /usr/lib/system/libsystem_c.dylib)
==5687== by 0x10032021B: printf (in /usr/lib/system/libsystem_c.dylib)
==5687== by 0x100001C4E: ??? (in /bin/ls)
==5687== by 0x100001A6F: ??? (in /bin/ls)
==5687== by 0x1002825AC: start (in /usr/lib/system/libdyld.dylib)
==5687== by 0x2: ???
==5687== by 0x104809B02: ???
==5687== by 0x104809B05: ???
==5687== by 0x104809B0A: ???
==5687== Address 0x100b977f0 is 0 bytes inside a block of size 1,537 free'd
==5687== at 0x100010920: realloc (in /usr/local/Cellar/valgrind/3.11.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so)
==5687== by 0x1002E1B06: fts_build (in /usr/lib/system/libsystem_c.dylib)
==5687== by 0x1002E2106: fts_children$INODE64 (in /usr/lib/system/libsystem_c.dylib)
==5687== by 0x100001CB0: ??? (in /bin/ls)
==5687== by 0x100001A6F: ??? (in /bin/ls)
==5687== by 0x1002825AC: start (in /usr/lib/system/libdyld.dylib)
==5687== by 0x2: ???
==5687== by 0x104809B02: ???
==5687== by 0x104809B05: ???
==5687== by 0x104809B0A: ???
==5687== Block was alloc'd at
==5687== at 0x100010920: realloc (in /usr/local/Cellar/valgrind/3.11.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so)
==5687== by 0x1002E1B06: fts_build (in /usr/lib/system/libsystem_c.dylib)
==5687== by 0x1002E2106: fts_children$INODE64 (in /usr/lib/system/libsystem_c.dylib)
==5687== by 0x100001CB0: ??? (in /bin/ls)
==5687== by 0x100001A6F: ??? (in /bin/ls)
==5687== by 0x1002825AC: start (in /usr/lib/system/libdyld.dylib)
==5687== by 0x2: ???
==5687== by 0x104809B02: ???
==5687== by 0x104809B05: ???
==5687== by 0x104809B0A: ???
==5687==
..
==5687== Invalid read of size 1
==5687== at 0x1000126C1: _platform_memmove$VARIANT$Ivybridge (in /usr/local/Cellar/valgrind/3.11.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so)
==5687== by 0x10031BEFC: __sfvwrite (in /usr/lib/system/libsystem_c.dylib)
==5687== by 0x100326652: __vfprintf (in /usr/lib/system/libsystem_c.dylib)
==5687== by 0x10034C6C0: __v2printf (in /usr/lib/system/libsystem_c.dylib)
==5687== by 0x100322381: vfprintf_l (in /usr/lib/system/libsystem_c.dylib)
==5687== by 0x10032021B: printf (in /usr/lib/system/libsystem_c.dylib)
==5687== by 0x100001C4E: ??? (in /bin/ls)
==5687== by 0x100001A6F: ??? (in /bin/ls)
==5687== by 0x1002825AC: start (in /usr/lib/system/libdyld.dylib)
==5687== by 0x2: ???


--------------------------------------------------------------------------------
References:
https://cxsecurity.com/issue/WLB-2015120089
https://cxsecurity.com/exploits/mac10116expl/10116metaExploits.dmg
https://cxsecurity.com/exploits/mac10116expl/10116hideContents.dmg
https://cxsecurity.com/exploits/mac10116expl/10116outofread.dmg
https://support.apple.com/en-us/HT205637
https://support.apple.com/en-us/HT205635
https://support.apple.com/en-us/HT205641
https://support.apple.com/en-us/HT205640
https://cxsecurity.com/issue/WLB-2015100149
https://cxsecurity.com/
https://cert.cx/

--------------------------------------------------------------------------------
Best Regards,
Maksymilian Arciemowicz ( https://cert.cx/ )
https://cxsecurity.com - Independent Information
Login or Register to add favorites

File Archive:

April 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close