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.3

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.3
File Size Uploaded
microtaint-0.7.3.tar.gz 548.3 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for microtaint 0.7.3
File
microtaint-0.7.3-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details
microtaint-0.7.3-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.3-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details
microtaint-0.7.3-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
microtaint-0.7.3-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.28+ x86-64, Linux glibc 2.17+ x86-64 Details
microtaint-0.7.3-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
microtaint-0.7.3-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
microtaint-0.7.3-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.3-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.3.tar.gz

Download URL microtaint-0.7.3.tar.gz
Size 548.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0dde0b2a5e6960aedaad582c19598cc84f6da89b3f82c5cf24a518054b6ccced
BLAKE2b-256 checksum
How to use checksums
40c98ae908916feb3fac4750bf2931a67b53fb8b832731f25294b73bcb7d6986
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.3-cp314-cp314-win_amd64.whl

Download URL microtaint-0.7.3-cp314-cp314-win_amd64.whl
Size 2.7 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
b80237de3a8d14164c2e0b4f22e36fb2346876824febd889b0f66fc0f1c60496
BLAKE2b-256 checksum
How to use checksums
89ca12baf1b26b760db19ecb4f26e3a7ac9c20875941134d6428e4a6a4b1e78e
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.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL microtaint-0.7.3-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
f449243dcb0ebb84168ea6482f9e799725b6657476d2e8e877e22dea9c2c25bd
BLAKE2b-256 checksum
How to use checksums
d11f6adfb8cf47dfd83ea4646d2e5f46921e47dcbad23f4c29b4d3984a9ec232
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.3-cp314-cp314-macosx_11_0_arm64.whl

Download URL microtaint-0.7.3-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
58793cbb3539bb16897fc2abe5069684287d64599e12499391dd8c8ce93e8ba9
BLAKE2b-256 checksum
How to use checksums
798755e034d81b94f6a02a237bea673849e21fcfbeca5d9a18ed4b4a859f1766
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.3-cp313-cp313-win_amd64.whl

Download URL microtaint-0.7.3-cp313-cp313-win_amd64.whl
Size 2.6 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
052625284a462903ca41fa0e8586b2ab682b6ccfe9b8338cabe15da8f81a4581
BLAKE2b-256 checksum
How to use checksums
898bd8292f25ceae344d82d755f02044679f3b89e5082c160fc0351c18684b7c
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.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL microtaint-0.7.3-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
f142753f7f3bdfca04b81ce7833e1c96ec23636b1fcc0da424194ff24493ab00
BLAKE2b-256 checksum
How to use checksums
1f6524ab2b787823c2020bde74f82b066b0f14b45a44ff2f3c4f5217fdfb0388
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.3-cp313-cp313-macosx_11_0_arm64.whl

Download URL microtaint-0.7.3-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
e7107efab02e81f89c1f9225d250e8a46c6bad27a77f5b20575ce6a1a3780206
BLAKE2b-256 checksum
How to use checksums
27b596f84c9baf9b88762848b3d31a1cbcf79f3e79dce31853c04f6b4e013887
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.3-cp312-cp312-win_amd64.whl

Download URL microtaint-0.7.3-cp312-cp312-win_amd64.whl
Size 2.6 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
086e2c9688d061f2b447a9496a2a81937c5cca220aab3dbc30e6c584d6eb5010
BLAKE2b-256 checksum
How to use checksums
df502878f78bb67b42d363e1f4cd25ed0ffd779898650eec855d35cf88b55dfa
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.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL microtaint-0.7.3-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
9fe4e5672eb6d3313d48f1aef551f01f4e939f735310f53794b408c4235104c8
BLAKE2b-256 checksum
How to use checksums
a7e183a695a6ef04d67a258af15c58250a66d41a1daa2e5c45a0b5a7cc3a34e7
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.3-cp312-cp312-macosx_11_0_arm64.whl

Download URL microtaint-0.7.3-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
b1d9d4c4c499150087282f7b16895c97c5abfa430229e69779b0777b307ccc68
BLAKE2b-256 checksum
How to use checksums
2edb8a919413a0d200770f80ebc531df48fd52f458080f2dccd09ec9723fdbfc
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

0.7.4

10 release files

This release

0.7.3 This release

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