Skip to main content

Microtaint

Code artifacts

The artifacts for NDSS27 are present in the artifacts/ndss27 subdirectory, in which there is a README explaining how to reproduce all the results presented in the paper.

They are archived at 10.5281/zenodo.22865047.

Introduction

Microtaint is a strictly typed Python library and command-line engine for performing bit-precise, dynamic Information Flow Tracking (IFT) on compiled binaries.

Originally an abstract rule generator based on the CELLIFT paradigm, Microtaint has evolved into a complete, out-of-the-box dynamic taint analysis emulator. Built on top of Qiling and Unicorn, it dynamically monitors program execution, identifies complex exploitation primitives (Buffer Overflows, Use-After-Frees, Side Channels, and Arbitrary Indexed Writes) and logs them in real-time.

It retains its foundational mathematical precision: behind the scenes, Microtaint still lifts executed instructions using Ghidra's P-Code (pypcode) and models them as logical ASTs, computing taint propagation rigorously down to individual carry/zero flags and partial register mutations.

Features

  • Out-of-the-box Vulnerability Hunting: Pre-built command-line flags to instantaneously trace standard input flows and check for vulnerabilities:
    • BOF (Buffer Overflow): Detects when the instruction pointer (RIP/PC) becomes tainted.
    • UAF (Use After Free): Monitors heap operations via a built-in HeapTracker and alarms on poisoned mapping accesses.
    • AIW (Arbitrary Indexed Write): Detects store operations executing with tainted pointer addresses.
    • SC (Side Channels): Emits findings when critical conditional branching decisions depend on tainted input.
  • Qiling-Powered Emulation Wrapper: Fully integrates with the Qiling Framework. Drop your ELF/PE/Mach-O binaries in with a custom rootfs, and Microtaint wraps the CPU states gracefully.
  • High-Performance Tracing: Built-in Cython BitPreciseShadowMemory, direct Unicorn state hooks, and custom JIT caching ensure fast execution capabilities.
  • Bit-Precise Rule Generation: Still capable of generating mathematical formulas statically (via generate_static_rule), treating raw assembly instructions as monolithic logical circuits evaluated using simulated differentials.

Installation

Microtaint is available on the pypi, so you can use uv/pip/your_favorite_tool to install it.

If you want to build it locally then once you cloned the repo you can use uv to build it.

uv sync --reinstall-package=microtaint

That build targets the baseline x86-64, so the result runs anywhere. To tune it for the machine you are on, which is what you want for timing work:

CFLAGS="-march=native" uv sync --reinstall-package=microtaint

Published wheels are never built that way. -march=native on a build machine bakes in whatever that CPU happens to support, and a wheel is installed on machines that are not the one that built it.

macOS on Apple Silicon

Emulation needs one extra step there, and it is not ours to fix:

brew install keystone
sudo cp -L "$(brew --prefix)/lib/libkeystone.dylib" /usr/local/lib/

keystone-engine is a dependency of Qiling. Its last release is 0.9.2, from June 2020, which predates Apple Silicon and ships wheels only for macosx_10_14_x86_64, manylinux1 and Windows. With no arm64 library to load, its loader falls through to import distutils.sysconfig, and distutils was removed in Python 3.12, so what you actually see is ModuleNotFoundError: No module named 'distutils' followed by Qiling reporting Unable to import module .arch.x86. The real cause is the missing library, not distutils.

Homebrew ships keystone 0.9.2 with arm64 bottles, the same version as the Python binding, so the two match. /usr/local/lib is where the binding looks, and it is on the default dyld search path, so no DYLD_LIBRARY_PATH is needed (System Integrity Protection would strip it anyway).

The taint API itself does not need any of this; only emulating a guest does. Tracked upstream as keystone-engine#588 for the distutils half. Nothing upstream tracks the missing arm64 wheel.

Command Line Usage

Use the provided microtaint command to execute and dynamically analyze a binary. Provide flags before the -- separator. Any arguments after -- represent the execution format for your compiled target.

# Detect everything, feed stdin automatically from the terminal
uv run microtaint --check-all -- ./binary arg1 arg2

# Read binary taint source from a specific file instead of stdin
uv run microtaint --check-bof --input payload.bin -- ./binary

# Pipe raw data directly to the binary while applying the UAF trace
python -c "print('A'*64)" | uv run microtaint --check-uaf -- ./binary

# Execute quietly and emit structured JSON findings (useful for CI/fuzzers)
uv run microtaint --check-all --quiet --json -- ./binary 2>/dev/null

Python API Integration

1. Qiling Emulator Integration (High-Level)

The MicrotaintWrapper can be integrated manually onto any existing Qiling instance. This provides fine-grained control to programmatically trace or assert bitwise taints seamlessly during full-system/binary emulation.

from qiling import Qiling
from microtaint.emulator.wrapper import MicrotaintWrapper

# Setup standard Qiling Environment
ql = Qiling(["path/to/binary"], rootfs="/custom/rootfs")

# Mount Bit-Precise Taint Engine on top
wrapper = MicrotaintWrapper(ql)

# Enable active security modules
wrapper.check_bof = True  # Track instruction pointers
wrapper.check_aiw = True  # Track memory addresses
wrapper.check_uaf = True  # Monitor frees

# Taint specific memory regions: one mask byte per memory byte,
# so 12 fully tainted bytes at 0x1000
wrapper.taint_region(0x1000, b"\xff" * 12)

# Run Emulator
ql.run()

# Review findings identified by the Reporter
for finding in wrapper.reporter.findings:
    print(finding)

2. Stateless AST Generation (Low-Level)

For cases where you don't need full emulation but want to analyze the math and formulas of taint propagation for a specific instruction byte string, you can directly interface with the static generator and native evaluator:

from microtaint.sleigh.engine import generate_static_rule
from microtaint.simulator import CellSimulator
from microtaint.instrumentation.ast import EvalContext
from microtaint.types import Architecture, Register

arch = Architecture.AMD64
simulator = CellSimulator(arch)

# 1. Provide an instruction (AND EAX, 0x0F0F)
bytestring = bytes.fromhex('250f0f0000')

# 2. Lift it into a stateless logical circuit (AST)
circuit = generate_static_rule(arch, bytestring, [Register('RAX', 64)])

# 3. Form a concrete runtime execution context
ctx = EvalContext(
    input_values={'RAX': 0xFFFF},
    input_taint={'RAX': 0xFFFF},
    simulator=simulator
)

# 4. Mathematically evaluate how the taint propagates bit-by-bit
output_taint = circuit.evaluate(ctx)
# output_taint['RAX'] bitmask mathematically evaluates to 0x0F0F

Development & Testing

Run tests and check typings/formatting with:

uv run mypy .
uv run ruff check .
uv run pytest

If a C/Cython file has been modified it is necessary to force a rebuild of the .so shared libraries with a

uv sync --reinstall-package=microtaint

Metadata

Release files for microtaint 0.7.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for microtaint 0.7.4
File Size Uploaded
microtaint-0.7.4.tar.gz 548.3 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for microtaint 0.7.4
File
microtaint-0.7.4-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details
microtaint-0.7.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 Details
microtaint-0.7.4-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details
microtaint-0.7.4-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
microtaint-0.7.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details
microtaint-0.7.4-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
microtaint-0.7.4-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
microtaint-0.7.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 Details
microtaint-0.7.4-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details

Total release size: 25.0 MB

Release files / microtaint-0.7.4.tar.gz

Download URL microtaint-0.7.4.tar.gz
Size 548.3 kB
Tags Source
SHA-256 checksum
How to use checksums
cd4b71189c985f2744ea6599ed11cb2ca2fe3c7fc29697e350e18157b41f2a21
BLAKE2b-256 checksum
How to use checksums
0f476796715645352688b8eedf153815c5dd2b2d69d1ff1537f7e40ce30350f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / microtaint-0.7.4-cp314-cp314-win_amd64.whl

Download URL microtaint-0.7.4-cp314-cp314-win_amd64.whl
Size 2.7 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
78266b4d1b9e8eb993e2f4392b0bb1c201c69b32006d502d10db16a1298729f0
BLAKE2b-256 checksum
How to use checksums
65239218ee4844404d32c32b1119b005975151957571913c7971d56bee49cafc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / microtaint-0.7.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL microtaint-0.7.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 2.9 MB
Tags CPython 3.14 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
8156b4faa8d1bd52d2506ea7e11c9856a8a1644a44058a958bab04dbfb7446df
BLAKE2b-256 checksum
How to use checksums
73f993907c74f559e677bda97dc7b8e77c27f3e2f0232f6c9118a518a908498e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / microtaint-0.7.4-cp314-cp314-macosx_11_0_arm64.whl

Download URL microtaint-0.7.4-cp314-cp314-macosx_11_0_arm64.whl
Size 2.6 MB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
d42ff29cd90aea1e9329c7127d1929d7e2a70b98eb79417cc93438cd6296f74a
BLAKE2b-256 checksum
How to use checksums
5d7b6826eeb9d0e91d52802a0a7a70cd985611a3e7effe8d4db35df9ab40f58b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / microtaint-0.7.4-cp313-cp313-win_amd64.whl

Download URL microtaint-0.7.4-cp313-cp313-win_amd64.whl
Size 2.6 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
51de71c8a66e0c03254f9bfe77444c6f43110d2957d03ae9f8865c462f2c0a3e
BLAKE2b-256 checksum
How to use checksums
087973aa509ac8d3f291d450bbd9b3c4f19179279eb9673aac1c05947e37140a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / microtaint-0.7.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL microtaint-0.7.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 2.9 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
bb9fd5db85c0027579c2d7794c13643e4ff58159562b74f850dc1001b142f108
BLAKE2b-256 checksum
How to use checksums
14d66aef89da4e419a328c34adfa1822473c5a6ad1de1e83499434a8efe0b349
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / microtaint-0.7.4-cp313-cp313-macosx_11_0_arm64.whl

Download URL microtaint-0.7.4-cp313-cp313-macosx_11_0_arm64.whl
Size 2.6 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
287ed3cc4c70061a5c13d9a5637a79f32351055ff05fdcfe83383a716ad41c13
BLAKE2b-256 checksum
How to use checksums
190b0a6663b86fea1fffa6b408e5ea2d9bd73c5a6377cd8631fab6fc83dcd202
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / microtaint-0.7.4-cp312-cp312-win_amd64.whl

Download URL microtaint-0.7.4-cp312-cp312-win_amd64.whl
Size 2.6 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
394e471b74709e59501e229c7fc49f0fd2596cb32bcb37975b634bf5b375d222
BLAKE2b-256 checksum
How to use checksums
1ea197acfdf98bd83092bfa176d40351e896451e2e031256e75379bba28910a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / microtaint-0.7.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL microtaint-0.7.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 2.9 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
97725a9f3ce052e0c28df38c89381f7f4b26892e7c523311a138f1968b361e69
BLAKE2b-256 checksum
How to use checksums
be9df06de2aa09f8b9aac3e61a7253ada4e54e163d068f5c8b55be3fbb16f372
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / microtaint-0.7.4-cp312-cp312-macosx_11_0_arm64.whl

Download URL microtaint-0.7.4-cp312-cp312-macosx_11_0_arm64.whl
Size 2.6 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
03c7df577cc055e42a3d4d81a568abc3c5083d863bc862d8c19abf836d9b7381
BLAKE2b-256 checksum
How to use checksums
d1f33005cb7177d22f801633387a8cae9ffaa6c4c68602c2155e453580505c73
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.7.4 This release

10 release files

0.7.3

10 release files

0.7.2

10 release files

0.6.9

7 release files

0.6.6

7 release files

0.6.4

7 release files

0.6.0

7 release files

0.5.1

7 release files

0.3.1

9 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page