I’ve been mapping where Valknir goes next. Right now it finds malloc calls, basic double-frees, and use-after-free. Next from here are memory leaks, scope awareness, and alias tracking. Ultimately it’s a project for consolidating what I’m learning in security, and until recently that learning was pointing towards vulnerability research - but offensive security is increasingly where my interests lie. That shift made me ask whether Valknir’s original concept still fits the direction, and where it might expand if it does. Which led me to a feature I’ve since decided against - but worth writing about exactly why.
The feature was backdoor detection. I’d been reading up on the xz attack (CVE-2024-3094), and the process was fascinating to pick apart. It raised the obvious question: how do you defend against attacks that don’t come down to a memory bug at all? Binary exploitation is the floor. Above it is the whole open-ended space - build-chain compromise, dependency poisoning, abuse of the trust in a release process - where there’s no single primitive (or chain of them) to point a checker at. The problem is that a tool which flagged that kind of thing for developers would work just as well as a detection oracle for attackers.
Worth noting that this is true of any detector, Valknir’s planned ones included. Run it against your own planted double-free, see whether it flags, and you’ve learned whether the bug survives static analysis. (The current iteration is far too young to be much use that way, but the point stands.) Detection and evasion-testing aren’t two related things - they’re the same operation, read in opposite directions.
What stops that being a problem for the existing roadmap is that it gives an attacker nothing they don’t already have. Valknir isn’t competing on detection - its focus is clear explanation, not finding anything new. The best it can realistically be is as good as the strongest static analysers at spotting a double-free, not better, and any serious attacker already has those - fuzzers, sanitisers, CodeQL. So the dual-use is there, but no advantage is handed over that wasn’t already available. The real question was never “could an attacker use this” - everything clears that bar - but whether it hands them something they couldn’t already easily get.
Backdoor detection, on the other hand, is where that answer flips. A detector that scores suspicion leaks a gradient. Fewer flags each pass, so an attacker hill-climbs against it - refining the backdoor until the tool goes quiet. Valknir’s whole point is explainability. It doesn’t say suspicious, it says here is the tell and here is why. Pointed at backdoors, that hands the attacker the gradient in plain English. The property that makes it good for developers is the property that makes it dangerous in an attacker’s hands. An open, explainable map of how to find a backdoor - and by inversion, how to hide one - has no business being published.
The detectors that escape this are pass/fail on something unfakeable. Does the release tarball reproduce from the git tag - yes or no. No partial credit to optimise toward, no gradient to descend. That’s why serious supply-chain defence lives in reproducible builds and provenance rather than a spot-the-evil-code checker. The constraint isn’t avoid security features. It’s avoid building detectors with a climbable gradient.
Supply-chain backdoors are badly under-defended, and someone should definitely work on them. But explainable, open-source, source-level detection is not the way to do it, for the reason above.
None of which means a tool like that shouldn’t exist at all. It’s that it belongs to red teams and the like - sanctioned offence, working on the defender’s side - not to attackers or the general public. You don’t needlessly arm the army you’re defending against. If I ever do build backdoor detection, it stays private and scoped to that use. The crossing of the line is in the publishing, not the building.
Besides, those features would bloat Valknir into a scope-crept monolith. I want one clean, well-regarded tool, not a kitchen sink. Staying defender-advantaged and staying in scope turn out to be the same decision.