Skip to main content
loadwise sec reports code paths where input or missing scope can expose data. Findings are review prompts with a location, a rule ID, an impact level, a generic fix example and, where it is safe, a source-based fix.
Run loadwise sec deps --help, loadwise sec polyglot --help, or loadwise sec dockerfile --help for the options specific to those checks. It accepts the source-check flags of loadwise perf, including --format, --min-impact, --baseline, --write-baseline, --loadwise-config, --workspace, --policy, --json, --include-contextual, --ignore, --fail-on, --fix with --yes or --only and --no-comments or --no-format, --staged and --changed-since. --engine auto (the default) and --engine js both run TypeScript 6. --engine native (alias --native) runs TypeScript 7. The two engines can differ in coverage, so rerun with --engine js when comparing findings or investigating an unexpected result. Rules that need a package’s types stay silent until it is installed. Test, fixture, mock, example and story files are contextual (Test or example source.). --fail-on contract enforces no security rule by default. --fix --yes leaves ValidationPipe whitelisting for individual review because it can strip undecorated DTO properties.

Rules

committed-secret, compose-hardcoded-secret and the dockerfile- rules read project files rather than TypeScript: loadwise sec -p <tsconfig> scans the project folder (not explicit source files) with git ls-files, so ignored files are skipped; outside a git repository it walks the folder and never opens .env* files. .env.example, .env.sample and .env.template are checked for token formats only, and placeholder values (changeme, example, your-..., ${...}, test or dummy values) and default credentials for a local service are not reported or are contextual. Rules that moved from the performance checker kept their ids, and loadwise perf --ignore still accepts them.

Polyglot source checks

npx loadwise sec polyglot src/ accepts directories or individual .py, .go, .java, .cs and .rs files and needs the optional ast-grep binary. These are syntactic patterns without taint tracking: confirm that untrusted input can reach the call. They are not --ignore rule ids of the TypeScript source checks.

Dependency checks

loadwise sec deps --online [directory] reads npm-shrinkwrap.json in preference to package-lock.json (npm lockfile version 2 or 3), pnpm-lock.yaml or yarn.lock (version 1 or Berry) from the directory or the nearest parent that has one, and asks the OSV database (which includes the GitHub Advisory Database) about every pinned package version. It sends package names, ecosystems and versions. Answers are cached for 24 hours in the loadwise folder of the OS cache directory. It takes --format text|json (or --json), --include-contextual, --ignore and --fail-on. A network failure exits 2 rather than passing. The network is opt-in: loadwise sec --online and loadwise check --online add these findings to their security report, and without --online they print one note that dependency checks were skipped. The dependency check also accepts Cargo.lock versions 3 and 4 and includes the ecosystem in OSV queries. The Cargo adapter queries exact crates.io package identities and reports skipped local, patched, Git, private-registry and unresolved entries. Cargo production reachability is unknown. Python requirements and Go checksum files do not establish a supported dependency inventory. Deno deno.lock (version 5) and Bun bun.lock (text versions 1 to 3) contribute exact npm package identities. The scan reports skipped JSR, URL and other unsupported identities, and labels the production reachability of reported Deno and Bun packages as unknown. Deno pins without a tarball and Bun entries with an empty registry are skipped when registry settings make their provenance uncertain. JSON reports include the selected lockfile and the skipped identity count under dependencyCoverage. The scanner uses Cargo, Deno, or Bun only when the directory and its parents have no npm, pnpm, or Yarn lockfile. If no identities could be checked in a nonempty inventory, the scan exits 2 and retains its findings. A baseline refresh also exits 2 and preserves the Security section if any identities were skipped. Combined baseline refreshes update each requested checker section independently. Fresh npm answers from the older cache can still serve npm scans against the default OSV origin. New answers are written to a separate ecosystem-aware cache. For legacy Bun binary locks, use bun install --save-text-lockfile --frozen-lockfile --lockfile-only to produce a text lock. Set LOADWISE_OSV_URL in the process environment to send opt-in lookups to a trusted HTTPS mirror instead of https://api.osv.dev. Use an origin with no URL path or credentials. Each origin gets a separate cache, and lookup requests never follow redirects. Set LOADWISE_OSV_CACHE_TTL_SECONDS to a whole number from 0 to 86400 to shorten the cache lifetime. A value of 0 disables the cache. Each initial request has a 30-second timeout. All retries share 30 seconds of elapsed time across the lookup, including backoff and reading retried responses. Successful initial requests do not spend that allowance. Expired cache entries cannot satisfy a failed lookup. For npm advisories, reports include a complete resolved path to each reachable transitive occurrence. CI jobs that retain full reports should allow for their output size. If advisories affect every level of a deep dependency chain, doubling its depth can roughly quadruple the path data.

Project-defined row scopes

Row-scope checks read prismaScopes, drizzleScopes and kyselyScopes from the performance section of loadwise.config.json (see Project-defined access policy) and start only when the project names the model or table, its scoped property and the trusted helper that supplies an authorized scalar; column names such as tenantId mean nothing on their own. prismaScopes maps each generated model to its protected field and a named export of the project’s authorization module, so db.invoice.findMany({ where: { organizationId: requireOrganization() } }) is scoped; proof requires strict null checks, which the CLI enables for explicit source files with a policy. drizzleScopes names an exported table, its schema module, its scoped property (the ORM property, not the column name) and the trusted helper. A later .where() replaces the earlier condition, and every OR alternative must keep the scope. If a physical column is named AND, OR or NOT, configure the Prisma property that maps to it; quoted Drizzle properties such as "org-id" work with bracket access. Shapes the scanner cannot establish are reported as prisma-scope-unverified, drizzle-scope-unverified or kysely-scope-unverified. Kysely checks package-owned executed selects for an equality predicate using the configured authorization helper. These checks assume the helper authenticates the caller; middleware, injected clients, raw SQL and database row-level policies need separate verification. The import boundary for database modules is the maintainability dataAccess setting.

Request-data trace depth

The source analyzer follows up to three local caller hops by default. Set LOADWISE_TAINT_CALL_HOPS=4 on the scan command to include one additional service layer. The setting accepts 3 or 4. The additional layer can increase analysis work, so enable it for projects that need it.