Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.7.4 instead.
Reason given by maintainers: Compiled with AVX512-VL

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

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

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.2
File Size Uploaded
microtaint-0.7.2.tar.gz 547.7 kB Details

Built distributions (wheels)

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

Total release size: 25.1 MB

Release files / microtaint-0.7.2.tar.gz

Download URL microtaint-0.7.2.tar.gz
Size 547.7 kB
Tags Source
SHA-256 checksum
How to use checksums
61cbe87fc4b9d98beeaadaaee8b534e81504efe1812856c1b98065ef08652124
BLAKE2b-256 checksum
How to use checksums
9354eef56377152ddc31ba67e831db8a0fda162dd05dcf150d5efe44836474b3
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.2-cp314-cp314-win_amd64.whl

Download URL microtaint-0.7.2-cp314-cp314-win_amd64.whl
Size 2.7 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
4723e47b00678ebcbe0f8525927d77ee368fb066a0a6332c53e29a3b22d291a7
BLAKE2b-256 checksum
How to use checksums
00aaa46c445c3dbf4243329cf1399e76b6021ad4d3c2438bd4014b989be4c7a1
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.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL microtaint-0.7.2-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
cfdced8a01cc097a5a1ad2eb348964ee5b4a9b7bb6029b0391a94feaaf60e3fb
BLAKE2b-256 checksum
How to use checksums
b6f0f7258cfe4241a1cd3c32d55e2117bc71d91a8ae63ffc5eeca7597f49260c
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.2-cp314-cp314-macosx_11_0_arm64.whl

Download URL microtaint-0.7.2-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
dd436e13ed7544d47c78e9e42ebb64b72c0038ab7a21bacc89be9a5df51a9a3c
BLAKE2b-256 checksum
How to use checksums
23cbcaabe05d12abc3f9a43f76240356674454f066146a11dbaa3427083f14b0
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.2-cp313-cp313-win_amd64.whl

Download URL microtaint-0.7.2-cp313-cp313-win_amd64.whl
Size 2.6 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
7ede9f90c3317aaed4c26acdaeb690540a6a48aa634a315e9c32ad1ee89734b9
BLAKE2b-256 checksum
How to use checksums
c401442462f0b2c518924ef17a870e2c6ba10b53d0f9d165924830beebb66efc
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.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL microtaint-0.7.2-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
8804406efaa04bed196cbe1904f1e26fcacd066abf118f41f01d3321d8c7e36c
BLAKE2b-256 checksum
How to use checksums
450d185e060c1ea21b7044e86668db91f9f111b93553c06920ee50c39978e29d
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.2-cp313-cp313-macosx_11_0_arm64.whl

Download URL microtaint-0.7.2-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
70df318fc1fd8a890f22c438e0e9295f3f367c1525bbc4070ac9be4eaf166bca
BLAKE2b-256 checksum
How to use checksums
61f943c217bc96e155521cc988b40415b466bd414238322ed7e25303cc6a656c
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.2-cp312-cp312-win_amd64.whl

Download URL microtaint-0.7.2-cp312-cp312-win_amd64.whl
Size 2.6 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
c4e52223791205d3f8b9c66b340449c5eb40b6b8a211a3f2b4aea048a835dd44
BLAKE2b-256 checksum
How to use checksums
552b4b98e66845df25c1229062a4d0f87462a7b898850ed9e16a9bedf286cf55
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.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL microtaint-0.7.2-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
f61d6f7873cbf1623e7086197a824aacc1c809c763013a85ead8dca11f48432f
BLAKE2b-256 checksum
How to use checksums
eb6f54cc64fd0f1cd4da708b964bd687a7facf97c2b1c42f1d2a76c5051107d8
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.2-cp312-cp312-macosx_11_0_arm64.whl

Download URL microtaint-0.7.2-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
a227d34c934ef4026b10ff3a1fc6a5091dcaae533734d7e95cea25d61c57297d
BLAKE2b-256 checksum
How to use checksums
6b365466ab5e26b7f1f071e330d7324a313746daddcbc5cb6dff2871abee745c
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

0.7.3

10 release files

This release

0.7.2 This release

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