What it has found
A bug finder should show its work, and should be the first thing it is pointed at. This page lists what bughunt found in real code, what it found in itself, and what a reviewer found in bughunt that it had missed.
In its own code, by fuzzing
bughunt has fuzz targets for its own parsers. The first run found two bugs in under 20 seconds each.
| Target and promise | What broke it | Fix |
|---|---|---|
| host: whatever bughunt reads as "this machine", a browser-grade address parser reads the same way | http://[::1]example.com/ and http://[127.0.0.1] were accepted as this machine: text after a bracket was ignored, and a bracket was accepted around a plain address. Later, after 100,000 inputs, a name with a malformed international label. | An address must now have one plain shape. Anything else is refused, not interpreted. |
| routes: any routes listing becomes a description that holds together | A route such as /time/12:30 put a stray : into the description, and :30 was read as a parameter. | A route that cannot be described truthfully is left out, and counted. |
The inputs that broke each target are kept as seeds, so every run tests them again.
In bughunt 0.2.0, by an independent review
A reviewer who had not written the code was asked to break each promise in the documentation, and to prove each break by running it. These are the ones that mattered. All are fixed in 0.3.0, each with a test that fails without the fix.
| Promise | How it broke | Fix |
|---|---|---|
"Only GET unless --write" | The attack tool also tries each path with the methods it does not list. On a read-only run that meant DELETE, POST, PUT and PATCH to real routes, with the login token. | That probing is off for read-only runs. Proven against a server that records every method: 0.2.0 sent seven kinds, 0.3.0 sends GET only. |
| "Only this machine" | A proxy variable in the environment carried every request to the proxy. A settings file in the working folder could load code and set a proxy. Flags after -- could change the address. A description could fetch part of itself from another host. | Proxies are not used for a local address; bughunt always passes its own settings file; only pacing and narrowing flags are passed on; remote references are refused. |
| "The token never appears in a report" | When the server echoed the token back in an error, it went into the report and the logs. | The token is filtered from everything bughunt keeps. |
| "Could not run is never nothing found" | A scanner that failed reported "0 raw flags" with exit status 0. A Go package that did not compile reported "no fuzz targets". | Both are failures now, and exit status 2 covers "part of this did not run". |
| "What is left out is counted" | A scanned repo could hide a finding with a comment, with its own ignore file, or with an export setting, and nothing counted it. | None of the three is honoured. |
| "Only style rules are left out" | The list of rules left out by default included 18 security rules that flag every use of a common construct, counted as "style". | They are counted on their own line as broad security rules, and --broad shows them. |
| The list of routes never to call | It matched inside words: "sso" hid /lessons, and "auth" switched the login check off for /authors. | Words match whole name parts, and what the list leaves out is counted. |
The full list, including the smaller ones, is in the changelog.
In parda, by fuzzing
parda masks secrets and personal data before AI coding tools send them. Its fuzz targets check promises such as "a value that was found is gone from what leaves". Two bugs, each with a fix and a test:
- A stall. A long run of numbers, such as a pasted table, made one check take time with the cube of the run's length: 1.7 seconds for 4 KB of digits.
- A leak. A secret found by the name beside it (
DB_PASSWORD=…) was masked there, but left unmasked where the same request repeated it bare.
What this says about the method
- A promise beats "did not crash". None of the fuzz findings above was a crash in the usual sense. Each was a stated promise that an input broke.
- A second reader finds what a single one cannot. The host guard looked right to its author and passed its tests. Comparing it with another parser found the gap in seconds.
- Run it; do not reason about it. The review's most serious finding was in behaviour nobody had watched: which methods the attack tool really sends. It was found by logging what a server received.
- Tools miss things. The review found problems the fuzz targets had no promise for. That is why bughunt is one of three layers, and why it does not replace a person reading the code.