What the GitHub Secure Open Source Fund changed in modernc.org/sqlite
GitHub has published a post today that ends with the list of all alumni of its Secure Open Source Fund. modernc.org/sqlite is one of them: it took part in Session 5, three weeks of security training for maintainers, from 14 September to 1 October 2026.
This post is about what came out of it for people who use the module, and for anyone maintaining something like it.
Why this project
modernc.org/sqlite is SQLite without cgo. The C amalgamation is transpiled to Go by modernc.org/ccgo and the result is committed, for 20 GOOS/GOARCH targets. pkg.go.dev counts thousands of known importers, and many programs carry it without their authors knowing, as a transitive dependency. Until this spring it had one maintainer; now it has two. A widely used library, a small team and an unusual build are the case the fund exists for.
If you use the module
Reporting a vulnerability. SECURITY.md lists three private channels: private vulnerability reporting on the GitHub mirror, a confidential issue on GitLab, or an e-mail to the project’s GitLab Service Desk, which needs no account. Reports are acknowledged within seven days. A confirmed vulnerability gets an advisory and an entry in the Go vulnerability database, so govulncheck reports it. What happens after a report is in IRP.md, the incident response plan, published so that it can be read rather than taken on trust.
Knowing what you ship. Point a module-graph SBOM tool at this module and you get a clean-looking list that misses the largest thing in it: SQLite itself, transpiled into lib/, has no go.mod entry. The repository now ships its own SBOM, in CycloneDX and SPDX, covering the transpiled SQLite, sqlite-vec and the upstreams modernc.org/libc carries, musl among them, and every license text in LICENSE-3RD-PARTY.md. CI fails when any of them goes stale. SBOM.md explains the difference.
Knowing where a release came from. Since v1.60.0, vendor.json records which modernc.org/libsqlite3 and modernc.org/libsqlite_vec commits, and which Go release, the generated code was vendored from. Since v1.61.1, every release tag also gets a provenance document, signed with Sigstore by the GitLab pipeline the tag started, with no long-lived key involved. Before signing, the pipeline vendors the code again from the recorded commits and checks that it comes back byte for byte, and that gitlab.com and proxy.golang.org serve the same module. VERIFYING.md shows how to check a document and, just as carefully, what a valid one does not prove.
What the driver defends against. THREAT-MODEL.md goes through the places where input from outside the application reaches the hand-written Go: the connection string, the connection lifecycle, the page cache binding and the VFS bridge. Each row says who can supply that input, what goes wrong if the code is wrong, its status and the commit that settled it. Checking the draft against the code produced real fixes. One you may want to act on: a _pragma value in a DSN runs as SQL text, so anything after a ; runs too. If your DSN is not a compile-time constant, turn on StrictPragmas (since v1.60.0).
On the GitHub mirror, CodeQL, secret scanning with push protection, private vulnerability reporting and Dependabot alerts are on. Development still happens on GitLab, at gitlab.com/cznic/sqlite. The mirror is read-only for code, but issues, pull requests and reports filed there reach the maintainers.
If you maintain something similar
- You don’t have to move to GitHub to use its security features. Everything above works on a push mirror; branch protection there needs an admin bypass so that the mirror push still goes through.
- If your module vendors or generates code, stock SBOM tools will under-report it. Write the inventory once and let CI keep it honest.
- A threat model is worth what its review against the code is worth. A draft written from the API reads plausibly; the fixes came from checking each row against the source.
- Writing down what a signature does not prove turned out as useful as the signing.
What is not done
- Fuzzing. The module has one native fuzz target. Fuzzers for each input surface, and a differential fuzzer against SQLite compiled from C, are next.
- The threat model covers the hand-written Go. The transpiled C in
lib/is a different exercise, and scanning that much generated Go is still an open question. - Two maintainers are better than one, but it is still two.
Thanks
To Ian Chechin, a maintainer of the project, who did a large part of this work: the threat model, the vendor.json stamp and the signed attestations are his. To the Secure Open Source Fund team at GitHub, the instructors, and the other maintainers in Session 5, from whom I learned as much as from the sessions.
Comments
Post a Comment