Skip to main content
This page is the assurance case for Loadwise itself, not for the code it scans. Report a vulnerability through SECURITY.md.

Security requirements

What you can expect:
  1. Local analysis. Scans read and parse files on your machine or CI runner. Source code, project paths and lockfiles are not uploaded.
  2. Network only when you ask for it. A scan makes no network request unless you opt in:
    • --online sends pinned package names, ecosystems and versions to OSV, or to LOADWISE_OSV_URL, which must be an HTTPS origin or a loopback HTTP origin (lib/security/deps/osv.ts).
    • Crash reporting (--report-crashes, LOADWISE_CRASH_REPORTS=1 or LOADWISE_SENTRY_DSN) sends a sanitized report without exception messages, source or project paths (lib/shared/system/sentry.ts).
    • Separate commands that you run by name also use the network: loadwise perf db connects to the database named in your environment, and loadwise editor setup downloads the editor package from GitHub Releases and checks its SHA-256 digest and size against the release metadata (lib/editor/release-vsix.ts).
  3. Scans do not execute the scanned project. The checkers parse files with the TypeScript compiler API, @astrojs/compiler, libpg-query, yaml and the bundled @ast-grep/cli binary with Loadwise’s own rules. They do not run the project’s scripts, tests or build. Config files are read as JSON or JSONC, and rule packs are versioned JSON data. These documented exceptions load code from the project’s own node_modules:
    • loadwise fix, when it writes edits, formats them with the project’s installed Prettier, which also resolves the project’s Prettier config. Biome is used only with LOADWISE_ALLOW_BIOME=1, and only from a binary inside the project root (lib/shared/fix/fix-presentation.ts, fix-presentation-biome.ts). --no-format turns formatting off.
    • loadwise perf db loads the project’s pg, mysql2, mongodb or mongoose driver (lib/performance/db/drivers.ts).
  4. Writes only on request. loadwise fix previews by default. It writes only with an edit mode (--apply/--yes, --id, --all, or approval in --interactive), and every write to a project file stays inside the project root (lib/shared/fix/project-file-access.ts). The fix history that loadwise fix records for undo is written outside the project, under the user’s state directory (LOCALAPPDATA or XDG_STATE_HOME), by lib/shared/fix/fix-history.ts.
  5. Another local user cannot plant a cached result. On POSIX systems, a cache directory or entry that another user owns or could write is ignored (see below). On Windows, where file stats carry no owner or permission bits, the cache is used only when its resolved folder lies inside the user’s profile or LOCALAPPDATA and no folder on the path is a junction or symbolic link. Any other LOADWISE_SCAN_CACHE_ROOT turns the cache off for that run, with a note.
What you cannot expect: Loadwise does not sandbox the project tools listed in point 3, and it does not guarantee that a scan finds every vulnerability. A missed or false finding is a bug, not a vulnerability (SECURITY.md, Scope).

Threat model and trust boundaries

The user running Loadwise, the Loadwise package as installed, and the project’s own installed tools (point 3) are trusted.

Secure design principles applied

  • Least privilege. Every workflow sets top-level permissions (most contents: read, Scorecard read-all) and raises them per job only where needed, for example id-token: write only in the npm stage and GitHub release jobs of .github/workflows/release.yml. Checkouts use persist-credentials: false.
  • Fail-safe defaults. Network features are off by default, fix previews by default, and an untrusted cache is bypassed rather than used.
  • Complete mediation of writes. All --fix writes to project files go through project-file-access.ts, which checks every path against the project root after resolving links and writes atomically. The check and the write are separate path operations, so they do not stop another local process that swaps a folder in the project between them.
  • Separation. Checkers run in child processes (lib/shared/reporting/pillars.ts) with bounded output (maxOutputBytes). When several source checkers are selected they share one child, so a failure there fails all of them.
  • Economy of mechanism. One glob dialect (lib/shared/system/glob.ts) and one JSONC reader (lib/shared/system/jsonc-config.ts) serve all config parsing.
  • Separation of duty in releases. The workflow can only stage an npm publish; a maintainer approves it on npmjs.com with 2FA.

Common weaknesses and how they are countered

Property-based fuzz tests with fast-check in test/shared/fuzz-properties.test.ts cover the JSONC comment masking and check that parseConfigFile rejects arbitrary config text only with a plain Error.

Supply-chain controls

  • Pinned actions. Every third-party action in .github/workflows/ and action.yml is pinned to a full commit SHA. Dependabot updates npm, Cargo and GitHub Actions dependencies weekly (.github/dependabot.yml).
  • npm provenance, no stored token. release.yml publishes with npm Trusted Publishing through GitHub OIDC and npm stage publish --provenance, after checking the tarball’s SHA-256 against the verified build. The version goes live only after maintainer approval with 2FA.
  • Signed release assets. The editor packages get Sigstore-signed SLSA build provenance (actions/attest-build-provenance), attached as loadwise-<version>.sigstore.json and .intoto.jsonl. Release signatures shows how to verify them.
  • Release gates. A tag publishes only from a commit on main whose check, codeql and scorecard runs passed (main-ci-green job). The release tags ruleset blocks moving or deleting v*.*.* tags.
  • CodeQL. .github/workflows/codeql.yml analyzes JavaScript/TypeScript and GitHub Actions on pushes to main, pull requests and weekly. The main ruleset blocks merges with CodeQL errors or high-severity security alerts.
  • OpenSSF Scorecard. .github/workflows/scorecard.yml runs on main and weekly and publishes results.
  • Required CI. main requires the CI passed check from .github/workflows/check.yml, which runs format, lint and the Linux test suite on every pull request. Every push to main also runs the Windows, Node 22 and macOS tests. On a pull request, Windows and Node 22 run when CI, packaging or platform-sensitive files change or with the full-ci label, macOS runs only with the full-ci label, and the package smoke test runs when packaging inputs change. CI passed accepts a scoped-out job as skipped and fails on any other result.