Tier: single-user local tool and rendering library.
pgfmt is a Go library and CLI (cmd/pgfmt) that formats Postgres SQL
from stdin or local files. It uses only the Go standard library and
makes no network requests or database connections.
- Crafted or deeply nested SQL input that causes panics, token corruption, or unbounded CPU and memory use during lexing or layout.
- A compromised dependency in
tools.modororacle/go.mod.
Resolve scanner findings in these areas as accepted_risk instead of
adding defensive code:
- Caller-supplied paths and in-place writes:
cmd/pgfmtreads and rewrites the file paths passed by the caller. Path confinement and symlink TOCTOU guards on the user's own files are out of scope. - Local user compromise: An attacker who already runs commands as the user owns the process, environment, and files.
- SQL execution semantics:
pgfmtonly reformats SQL text and verifies token preservation. It never executes SQL or validates query safety.