perfr, from Orbit · Post 31

Eighty-Seven Alerts

perfr's repository has two scanners on it, CodeQL and OpenSSF Scorecard, and the page they write to had filled up: 87 open alerts. This post sorts them. Seventy-two were one sentence repeated, five were real bugs in two test scripts, fifteen dependency advisories sat behind a single row, and six cannot be closed by a commit at all. Four pull requests closed 81 of them, and the other six are written down here with the reason each is still open.

87open alerts, from two tools, which came to 13 different findings
72of them one finding: a workflow running something named by a tag
12 of 15dependency advisories gone by updating; three have no fixed version
6still open, because a setting, a reviewer or ninety days closes them, not a commit

Two tools write to that page. CodeQL reads the code and reports flows it can prove: this value came from a request and reached that file open. Scorecard reads the repository's habits: are the workflows pinned, is there a policy, does anything fuzz the parsers. One row on the page is one place one tool objected, so a habit that is wrong in seventy places is seventy rows. Grouped by rule, the 87 were these.

RowsToolFindingClosed by
72ScorecardA workflow dependency not pinned by hash: 66 actions, five pip install steps, one curl | sh#82
1ScorecardNo dependency update tool#82
3CodeQLPath built from a request (py/path-injection)#83
1CodeQLHeader built from a request (py/http-response-splitting)#83
1CodeQLTLS 1.0 and 1.1 accepted (py/insecure-protocol)#83
1Scorecard15 known vulnerabilities in the lockfiles#84
1ScorecardNo security policy#85
1ScorecardNot fuzzed#85
2ScorecardBinary artifacts in the source treeopen, on purpose
4ScorecardNo branch protection, no approved reviews, repository under 90 days old, no best-practices badgeopen, not code

Seventy-two times the same sentence

A workflow step that says uses: actions/checkout@v4 runs whatever commit the tag v4 points at when the job starts. A tag is a name its owner can move. Whoever can push to that action's repository, or takes over an account that can, moves the tag and their code runs in perfr's release job, with everything that job is allowed to do. This has happened to widely used actions, which is why the scanner asks for the 40 hex digits of a commit, which cannot be moved, where the tag was.

There were 66 such lines across ten workflows. Each now names the commit its tag pointed at on the day, with the version in a comment, so nothing that runs has changed:

- uses: actions/checkout@v4
+ uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0

The other six rows were the same habit outside uses:. Five steps ran pip install pyarrow or the like and took the newest release of each package. They install with --require-hashes from requirements files compiled by uv pip compile --universal --generate-hashes, so a package is the file it was on the day the pin was made or the install fails. One step fetched Julia by piping an installer from the network into a shell. It downloads the 1.13.4 archive and checks it against the hash julialang.org publishes. The Zig, Kotlin and Swift archives in the same workflow were not on the scanner's list, since they are downloaded and unpacked and not piped, but they were the same risk and they are checked now too. Swift publishes signatures and no hash, so that one is checked against the archive as it was on 18 November, which catches a change and not an archive that was already wrong.

A pin nobody moves is its own problem: the pinned commit is where the action's own fixes stop arriving. That is the second alert in the pull request. .github/dependabot.yml has Dependabot propose the new pins weekly, one grouped pull request each for the actions, the cargo lock, the pip requirements and the web package, so that moving a pin is a diff someone reads.

Five real ones

CodeQL's five were all in two end-to-end scripts that test the Share button. Each starts a small web server on 127.0.0.1 for the length of one test, so nobody was exposed by them. Two were still wrong in a way worth showing, because the same lines get copied into servers that are exposed. The static file handler was:

file = (VIEWER / rel).resolve()
if not str(file).startswith(str(VIEWER.resolve())) or not file.is_file():
    self.send_error(404)

It resolves the path and checks that the result begins with the directory's name. A directory beside it named viewer-dist-old begins with that name too, so ../viewer-dist-old/x passes. Adding a separator to the comparison fixes that case. The change made was a different one: the server builds a table of the pack's files when it starts, and a request looks its path up in the table. A request names a key and never a path, and there is no comparison left to get wrong.

The login handler copied the next value from the query string into a Location header, where a line break in the value starts a header of the sender's choosing. Line breaks are removed, and the redirect is followed only to a path on the same server or a URL on the same machine. The other script's TLS server accepted TLS 1.0 and 1.1 and now asks for 1.2. CodeQL run on the branch reports no results where it reported five.

Fifteen behind one row

Scorecard's vulnerability check runs OSV-Scanner over every lockfile and reports one alert with a list in it. Fifteen entries, in two lockfiles. A profiler has a particular reason to read such a list closely: it opens files from other people. A capture is a zip of Parquet tables that arrives in a bug report or behind a share link, and symbolizing means parsing whatever binary the profiled process happens to be.

PackageAdvisoryWhat it is hereChange
arrow-dataout-of-bounds read on a malformed run-end-encoded arraythe reader of every .perfr.zip59.3.0 → 59.3.3
ruzstda few bytes of zstd that ask for all of memoryinflates compressed debug sections of the target's binaries0.7.3 → 0.9.1, by object 0.36 → 0.41
tokio, rustixI/O-safety and buffer fixesthe async runtime and the system-call layerpatch releases
zvariant, zbus_names, zvariant_deriveunmaintainedunder the native viewer's file dialogsgone, by rfd 0.15 → 0.17
basic-ftp, extract-zip, zodsix advisoriesunder a browser test's development dependencygone or fixed, by puppeteer-core 24 → 25
paste, ttf-parser, chronounmaintainedunder wgpu, egui and arrowrecorded, not fixed

Twelve went by updating, and two of the updates were more than a version number. object 0.41 wraps its ELF and PE constants in types, so a dynamic tag is a DynamicTag and not a number that happens to compare equal to one; perfr's reader changed in about ten places. And the file-dialog crate reached the desktop portal through a pure-Rust D-Bus stack whose three lowest crates have lost their maintainer. Its newer release talks to the system's own libdbus, which took those three out of the lock along with 35 others, most of them an async runtime that nothing else used. The web package's lock went from 81 packages to 26 for one line changed.

Three have no version to update to. Each advisory says the crate has no maintainer, not that it has a flaw, and each sits under a dependency that cannot be swapped without moving the viewer to a new major version of its UI or data stack. They are listed in osv-scanner.toml, each with where it comes from and why it stays, and each entry expires in six months, after which the scanner reports it again. One of the three, chrono, was not on the page at all: the weekly scan of 16 November did not list it, and the scanner run on the tree two days later did.

A policy and a fuzzer

The last two alerts asked for things the repository did not have. SECURITY.md says how to report a vulnerability in private, through GitHub's advisory form, what happens after, and what counts. That last part took the most thought. The service has no login: on 127.0.0.1 it decides by Host and Origin who it answers, and with --host 0.0.0.0 it answers the network, as its help says. So the policy draws the line there. A web page on another origin reaching the API is a vulnerability. The API having no password when it was put on the network on purpose is the manual.

For fuzzing there are now five cargo-fuzz targets, one for each kind of bytes perfr reads and did not write: a .perfr.stream or a remote machine's frames, a .perfr.zip bundle, a Chrome or Perfetto trace, the JSON description of the machine a capture ran on, and /proc/<pid>/maps. They live in a workspace of their own, so an ordinary build never meets libFuzzer, and they build against the service's lockfile, so what is fuzzed is the versions that ship. A workflow runs each for two minutes a week and keeps any input that crashes one.

target        seconds   inputs       result
live_stream        75    8,645,797   no failure
cpu_topology       75    5,491,343   no failure
chrome_trace       90    4,191,717   no failure
proc_maps          60    3,333,795   no failure
bundle             90    1,617,057   no failure

That is a first run on one machine and it found nothing, which says the parsers survive a minute of noise and little more. The ELF, PE and PDB readers and the DWARF unwinder, which read the profiled program's own binaries, are not fuzzed yet and are the obvious next targets.

What a commit cannot close

Six rows are still open.

Two are the same file kind: a .wasm in the source tree. The scanner is right that a compiled binary in a repository cannot be reviewed and may not be what the source beside it builds. Both are there on purpose. The service embeds the viewer's WebAssembly pack, and the pack is committed so that cargo build produces a working service without a wasm toolchain; the web package commits its recorder the same way. What stands in for review is a check: the pack records a hash of the sources it was built from, and continuous integration fails a pull request whose pack does not match its sources, or whose sources changed while the pack did not. That makes a stale pack impossible to merge. It does not prove the pack is what those sources compile to, and the alert stays open as the reminder that a reproducible build of the pack in CI would.

The other four are about how the project is run. Branch protection is a setting. Approved reviews need a second person: the check counted 0 of the last 16 changes as reviewed, which is what one maintainer merging their own work looks like. The best-practices badge is a questionnaire. And "maintained" scores zero for any repository less than 90 days old, which this one is until late January.

What the number is

Scorecard checkBeforeAfter
Pinned-Dependencies010
Dependency-Update-Tool010
Vulnerabilities010
Security-Policy010
Fuzzing010
Binary-Artifacts88

Five checks went from nothing to full marks in a day, and it is worth being plain about what that measures. Scorecard gives ten for fuzzing to any repository with a file that mentions libFuzzer, and ten for vulnerabilities to a lockfile whose remaining advisories are listed in an ignore file. Neither is a claim that the parsers are sound or the dependencies safe. The score counts habits, and the habits are now in place: a workflow cannot run code nobody chose, a known advisory is fixed or has a written reason and a date, the parsers are fed noise every week, and someone who finds a hole knows where to send it. Whether those habits find anything is next year's post.

The short version. Of 87 open code-scanning alerts, 72 were workflow steps that named an action by a movable tag, fixed by pinning 66 actions to commits, five pip installs to hashes and four toolchain downloads to checksums, with Dependabot to move the pins. Five were CodeQL findings in two test scripts, among them a startswith path check that a sibling directory passes. Fifteen dependency advisories became twelve updates and three written exceptions with expiry dates. A security policy and five fuzz targets closed two more. Six remain: two committed .wasm packs kept on purpose, and four that need a setting, a second reviewer, a form, or the repository to turn 90 days old.