Urgent.News

What's breaking now, across thousands of outlets.

Tech

My "reproducible" build kept returning the same hash after the code changed. That was the bug.

TL;DR: I built ZeroTrust — a supply-chain security scanner, zero third-party dependencies, go.mod with no require block — for the Zero Dependency Hackathon (Track E). It catches phantom packages, typosquats, lifecycle-hook backdoors, obfuscated payloads, and eval()-style dynamic execution. The scanner passed every test I wrote for it. Three times, my own verification process tried to hand me a…

The ZeroTrust supply-chain security scanner, developed for the Zero Dependency Hackathon, faced unexpected challenges during its testing phase. Despite passing all five checks that the tool designed to detect issues like phantom packages, typosquatting, and obfuscated payloads, it began to raise questions about its own reproducibility.

After multiple successful runs of the build, the identical hash produced by the process started to feel suspicious, as it did not align with the expected outcome of a clean build. Upon investigation, the source code changes made during the testing sessions became evident, revealing that the reproducible build hash was changing even when the code remained unchanged.

This led to the conclusion that the hash was not accurately measuring the integrity of the code but was instead being influenced by various factors like documentation edits. To address this issue, the tool was rebuilt with additional flags, ensuring a true reproducible build by disabling the inclusion of version control information in the binary.

The corrected build hash was verified to be identical across multiple runs, confirming the success of the fix. However, another challenge arose when attempting to run the race detector on the Windows environment. The race detector required a working 64-bit C compiler, which was not available on the developer's local MinGW toolchain.

This prevented the verification of the tool's own claim of being free from data races on the development platform. Rather than attempting to modify the toolchain, the decision was made to run the race detector on a different environment, specifically a Linux-based Docker container, where it successfully completed without any issues.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Saturday 5 September →