Blog · 2026-10-30

Taint is not a boolean

Why our engines track a set of vulnerability classes per value, how sanitizers clear only what they neutralise, and what a numeric conversion keeps.

Most taint analysers carry one bit per value: tainted or clean. A sanitizer flips it to clean. That model has a blind spot that shows up constantly in real code:

$name = htmlspecialchars($_GET['name']);
$db->query("SELECT * FROM users WHERE name = '$name'");

HTML escaping makes the value safe to print in a page. It was not designed for SQL: depending on its flags it may leave single quotes alone, it never handles backslashes, and in a numeric context no quote is needed at all. A one-bit model calls this clean.

A set of classes per value

Our engines track a bitmask of vulnerability classes per value: SQL, command, path, XSS, SSRF, redirect, LDAP, XPath, header, template, deserialization and more. A source sets all of them. Each sanitizer clears only the classes it actually neutralises: htmlspecialchars clears XSS, a parameterised query clears SQL, basename clears path traversal. A sink fires when the value still carries its class, so the example above is still reported as SQL injection.

Converting to a number

A value parsed as an integer cannot inject anything, so numeric conversion clears every injection class. But it keeps one bit: the attacker still chose the number. That bit is what an unbounded allocation (new char[n], Vec::with_capacity(n)), an out-of-range index, or an integer overflow (a * b on two request values) needs. A bound check against a constant or a length clears it, as does clamping (Rust's .min(4096)); a sanitizer for some other class does not.

Proofs, not just findings

The same masks let an engine prove something stronger than "no finding": that a sink is safe even when every parameter, field and unknown call is assumed hostile. When that proof holds, the matching line-level pattern finding is withdrawn — which is how a concatenated SQL string built only from constants stops being reported. You can watch the masks at work in the live demo: the Python sample's fix escapes the value for HTML, and the XSS finding disappears.