xsscx / xnuimagefuzzer

XNU Image Fuzzer - iOS App for Fuzzing Images with Objective-C Code covering 12 CGCreateBitmap & CGColorSpace Functions working with Raw Data and String Injection.
https://srd.cx/xnu-image-fuzzer/
GNU General Public License v3.0
35 stars 2 forks source link
crash debugging exploit file fuzz fuzzing graphics image imagefuzzer interposing ios iosonmac macos objective-c research security utt xcode xnu

XNU Image Fuzzer

Last Updated: SUN 02 JUN 2024, 0800 EDT

Project Summary

The XNU Image Fuzzer Source Code contains a proof of concept implementation of an image fuzzer designed for XNU environments. It aims to demonstrate basic fuzzing techniques on image data to uncover potential vulnerabilities in image processing routines. The Objective-C Code implements 12 CGCreateBitmap & CGColorSpace Functions working with Raw Data and String Injection that are User Controllable Inputs.

Build & Install Status

Build OS & Device Info Build Install
macOS 14.5 X86_64
macOS 14.5 arm
iPadOS 17.5
iPhoneOS 17.5
VisionPro 1.2

XNU Image Tools

Command Line Version

See URL https://github.com/xsscx/macos-research/tree/main/code/iOSOnMac

Project Support

Project Documentation

URL https://xss.cx/public/docs/xnuimagefuzzer/

whoami

Quick Start

Copy Fuzzed Files

XNU Image Fuzzer iPhone 14 Pro Max Render #1 XNU Image Fuzzer iPhone 14 Pro Max Render #2

How-to Rebuild Xcode Project

xnuimagefuzzer % rm -rf CMakeCache.txt CMakeFiles CMakeScripts cmake_install.cmake build

Create a Test Folder

xnuimagefuzzer % mkdir xcode_build

Create the Xcode Project

xnuimagefuzzer % cd xcode_build
xnuimagefuzzer/xcode_build % cmake -G Xcode ../XNU\ Image\ Fuzzer/CMakeLists.txt
-- The C compiler identification is AppleClang 15.0.0.15000309
-- The OBJC compiler identification is AppleClang 15.0.0.15000309
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting OBJC compiler ABI info
-- Detecting OBJC compiler ABI info - done
-- Check for working OBJC compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang - skipped
-- Configuring done (8.8s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/xss/Developer/xnuimagefuzzer/xcode_build

Open the Project, Run

xcode_build % open xnuimagefuzzer.xcodeproj/

Purpose of Using Fuzzed Images in Fuzzing

Overview

Embedding fault mechanisms into a generic image and further processing it through fuzzing enhances the effectiveness of testing by uncovering edge cases and potential vulnerabilities in image processing software.

Benefits

Uncovering Edge Cases

Testing Robustness and Stability

Finding Security Vulnerabilities

Ensuring Compatibility with Various Formats

Automating the Testing Process

Process

  1. Prepare the Image:
    • Start with a generic image.
    • Apply initial fuzzing to introduce random mutations.
    • Embed specific fault mechanisms to target vulnerabilities.
  2. Submit to Fuzzing Harness:
    • Load the processed image into a fuzzing framework like Jackalope.
    • Configure the tool to use the image as a seed for further automated fuzzing.
  3. Monitor and Analyze:
    • Monitor for crashes, hangs, and other signs of vulnerabilities.
    • Collect and analyze the results to identify and understand the bugs found.

Conclusion

Using fuzzed images enhances fuzzing effectiveness by uncovering edge cases, testing robustness, finding security vulnerabilities, and ensuring compatibility with various formats. This approach provides comprehensive evaluation and helps create more resilient software.