Weekly ZAP scans and npm package checks for a Supabase backup CLI
BackupDrill is an MIT-licensed CLI that backs up a Supabase project's Postgres database to your own S3, R2 or B2 bucket. Running backupdrill drill checks a backup by restoring it into a throwaway Postgres container. Our
BackupDrill is an MIT-licensed CLI that backs up a Supabase project's Postgres database to your own S3, R2 or B2 bucket. Running backupdrill drill checks a backup by restoring it into a throwaway Postgres container.
Our first ZAP scan of the project's website flagged a waitlist form that put email addresses in the URL. The scan runs every Monday in GitHub Actions, and BackupDrill's entry in ZAP's success stories gives the short version of the setup. Here's the workflow, the rules file, and what the November 23 run still reported.
The CLI is published to npm, and Yarn's package page for backupdrill lists the same npm package. I unpacked the published 2.11.1 tarball, then installed it with npm install and with yarn add (Yarn 1.22.22). Both installs recorded the same integrity hash.
The ZAP baseline scan
We run ZAP's passive baseline against the public site. It crawls the pages and checks the responses without running an active scan. The crawler can still submit forms, as the first run showed. The job runs on a schedule, on manual dispatch, and on any pull request that changes the workflow or the .zap/ folder, so a broken rules file shows up before it merges. The core step:
- name: ZAP baseline scan
uses: zaproxy/action-baseline@de8ad967d3548d44ef623df22cf95c3b0baf8b25 # v0.15.0
with:
target: "https://backupdrill.com/"
docker_name: "ghcr.io/zaproxy/zaproxy:stable"
cmd_options: "-c .zap/rules.tsv"
fail_action: false
allow_issue_writing: false
The action and actions/checkout are pinned to commit SHAs. The ZAP image uses the stable tag, so the job picks up new stable releases without a manual digest bump.
Alerts don't fail the job, and it doesn't open issues. Most baseline alerts are hardening advice, and a job that's red every week stops being read. A scan that can't run at all, such as when the site is unreachable or the rules file is malformed, still fails.
The rules file goes to ZAP through cmd_options and not the action's rules_file_name input. With rules_file_name, the action reads the file itself, collects only the IGNORE rows, and adds -c only if it collected at least one. A read error is logged, not raised. If parsing stops before the first IGNORE row, or the file contains only WARN and FAIL overrides, ZAP runs with its defaults, and the job can still pass. Passed through cmd_options, the file is read by ZAP, and the action fails the job when ZAP exits with code 3.
One more detail: IGNORE in the rules file only affects the summary in the job log. The HTML, JSON and Markdown reports still list every ignored alert. So the workflow uploads all three reports as an artifact and adds a step that filters report_json.json with jq against the rules file, then writes the remaining alerts as a table to the run summary.
What we ignore, and why
Six rules are set to IGNORE, each checked against a run of ZAP 2.17.0 on the live site:
-
10099, Source Code Disclosure - SQL. The Postgres guides are full of
grant,selectandrevokeexamples. The rule matches text patterns and can't tell an example from a leak. -
10098, Cross-Domain Misconfiguration. Vercel sends
Access-Control-Allow-Origin: *on static and prerendered pages. Those pages are public and don't use cookie auth, so there's nothing private to read. - 10015, 10049, 10050. Three notices about CDN caching headers. The caching is intentional.
-
10031, User Controllable HTML Element Attribute. The crawler submitted a form by GET with
host=neon, which happened to match a radio button's ownvalue="neon". The server doesn't render query parameters into the page.
We leave the other rules at their default severity.
What it found
The first run, on October 18, reported five warning types. One was a real bug: rule 10024, sensitive information in a URL, on five guide pages. The waitlist form on those pages had no method. If someone submitted it before React hydrated, the browser fell back to a native GET and put ?email=... in the URL, where it lands in access logs and browser history, and the signup wasn't saved either. The fix went out the same day: method="post" on the form, the submit button disabled until hydration, and a test that fails if any <form> in the app doesn't declare a method.
The run on November 23 crawled 190 URLs:
FAIL-NEW: 0 FAIL-INPROG: 0 WARN-NEW: 7 WARN-INPROG: 0 INFO: 0 IGNORE: 5 PASS: 56
Rule 10024 is gone. 10031 no longer fires either, since the crawler can't GET-submit the form anymore, which is why IGNORE shows 5 and not 6. The fix did produce a new warning, though: 10202, Absence of Anti-CSRF Tokens, on the same five pages. The form is now a POST with no token field, and the scanner only sees the HTML. It's still on the list.
The header warnings were already known when the scan was added. The CSP header only sets frame-ancestors 'none'. Responses carry X-Powered-By: Next.js. There's no Permissions-Policy and no cross-origin isolation headers.
Two alerts are newer and point at content, not headers. "Timestamp Disclosure - Unix" flags 1792430998 on the Prometheus guide, which is the backupdrill_backup_last_success_timestamp_seconds value in an example metrics output. "Modern Web Application" (10109, informational) flags the slides page, whose <noscript> fallback tells visitors the slides need JavaScript. ZAP adds that the client spider may crawl such a page better than the standard one.
The summary table shows 12 rows while the log says 7 warnings. ZAP counts by rule ID, and the table lists each alert name, so rule 10055 alone contributes four CSP rows.
What the npm package ships
The CLI repository ignores dist/, so the published JavaScript only exists after a build. package.json handles that with:
"prepublishOnly": "npm run build && npm test"
When we run npm publish from the checkout, prepublishOnly runs tsc and the 45 test files under test/. If the build or a test fails, npm stops the publish.
The files allowlist covers dist, plugin/skills, README.md and LICENSE. dist and plugin/skills are whole folders, so the allowlist alone doesn't prove what's inside them. I pulled the published 2.11.1 tarball from the registry and listed everything outside dist/:
$ npm pack [email protected]
$ tar tzf backupdrill-2.11.1.tgz | grep -v '^package/dist/'
package/LICENSE
package/plugin/LICENSE
package/plugin/README.md
package/package.json
package/plugin/skills/supabase-backup/references/postgres-backup-basics.md
package/README.md
package/plugin/skills/supabase-backup/SKILL.md
package/plugin/skills/supabase-backup/assets/scheduled-backup.yml
That's 76 files in total, 294,773 bytes compressed and 847,765 unpacked, with no tests, source maps or env files. The plugin/skills folder is in there on purpose. package.json lists it under pi.skills, so pi install npm:backupdrill gives the Pi agent the same backup skill the Claude Code plugin uses.
Relative README links broke on a site that copies it
The CLI's README used to link plugin/, plugin/README.md and examples/scheduled-backup.yml with relative paths. GitHub resolves those against the repository. One site that republishes our npm README built them from the package's homepage field plus /blob/master/, so readers landed on 404 pages on the website. Those four links are now full GitHub URLs, and the README inside the 2.11.1 tarball has no relative links left.
Same bytes through Yarn
I installed the package with Yarn 1.22.22 into an empty folder and compared it with what npm reports:
$ grep -A3 '^backupdrill@' yarn.lock
[email protected]:
version "2.11.1"
resolved "https://registry.yarnpkg.com/backupdrill/-/backupdrill-2.11.1.tgz#32fe939d6d0f58566c7211abef3c2d0a825add13"
integrity sha512-pfHb3AE9NuAt8l5146k0W+fbGdf00YoQCAbfm1KLrMI/sIFhnYr4CfdLlEofte8biz6JRYD5yFPBv544lmHfdg==
$ npm view [email protected] dist.integrity dist.shasum
dist.integrity = 'sha512-pfHb3AE9NuAt8l5146k0W+fbGdf00YoQCAbfm1KLrMI/sIFhnYr4CfdLlEofte8biz6JRYD5yFPBv544lmHfdg=='
dist.shasum = '32fe939d6d0f58566c7211abef3c2d0a825add13'
Same integrity hash and the same SHA-1 as the tarball npm pack downloaded. yarn backupdrill --version prints 2.11.1, and so does the binary under Node 20.20.2, the oldest major version the engines field allows.
Signatures, and the gap
After an npm install, npm audit signatures reports:
audited 53 packages in 1s
53 packages have verified registry signatures
8 packages have verified attestations
All 53 packages, backupdrill included, carry the registry's signature. The 8 with provenance attestations are dependencies from the AWS SDK tree. For backupdrill 2.11.1, the registry lists a maintainer account as publisher and shows no provenance attestation. The CLI repo's only Actions workflow builds the Docker image. Publishing from GitHub Actions with npm provenance would let anyone trace a release back to the commit and workflow run that built it.
The CLI has four direct dependencies (@aws-sdk/client-s3, @aws-sdk/lib-storage, commander, pg), and the install pulled in 53 packages. On my machine node_modules took 22 MB on disk, including 11 MB for @aws-sdk, 7.5 MB for @smithy and 984 KB for the backupdrill package itself.
I work on BackupDrill.
I used AI to help draft this post.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.