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.
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
angular-bypass-security-trust(high): DomSanitizer.bypassSecurityTrust* is called on a dynamic value, which turns off Angular’s built-in sanitization.auth-route-without-rate-limit(medium): A login, signup or password-reset route has no rate limiter.bcrypt-low-cost(medium): A bcrypt password hash uses a work factor below the recommended minimum.client-env-secret-exposed(critical): A secret-named env variable is read under a browser prefix (NEXT_PUBLIC_, VITE_, REACT_APP_…), so the build ships it to every visitor.code-injection(critical): Request-controlled input becomes source code evaluated by the application.command-injection(critical): Request-controlled input reaches a shell command string.committed-secret(critical): A tracked file contains a value that appears to be a credential.compose-hardcoded-secret(high): A Docker Compose service supplies a secret as a literal environment value.cookie-missing-security-flags(high): A sensitive cookie is set without the expected security attributes.cors-credentials-any-origin(high): A credentialed CORS response allows arbitrary origins.cors-origin-regex-unanchored(medium): A CORS origin regex also accepts look-alike hosts.database-error-in-response(medium): An HTTP response includes a raw database error message.discarded-signature-verification-result(high): A standalone call discards the result of Node.js synchronous signature verification.dockerfile-add-remote-url(medium): A Dockerfile ADD instruction retrieves a resource from a remote URL.dockerfile-runs-as-root(medium): The final image selects root or inherits an unverified base-image user.dockerfile-secret-in-build(high): A Dockerfile exposes a secret through a build argument or environment variable.dockerfile-unpinned-base-image(low): A Dockerfile uses a base image reference that can change between builds.dom-xss-sink(high): Untrusted or dynamic HTML reaches innerHTML, outerHTML, insertAdjacentHTML, document.write or createContextualFragment (DOM XSS).drizzle-scope-unverified(high): A Drizzle operation lacks the row scope required by the declared policy.drizzle-sql-raw-dynamic(critical): A dynamic SQL fragment reaches Drizzle without parameter binding.error-stack-in-response(medium): An HTTP response includes an internal error stack.escape-replace-incomplete(medium): A hand-written string escape replaces only the first match, or escapes a delimiter without escaping backslashes first.express-cookie-auth-missing-csrf(high): Cookie-based session or auth is paired with state-changing routes without CSRF protection orsameSite: "strict".express-missing-helmet(low): The Express or NestJS server starts without helmet security headers middleware (contextual: a proxy may set them).frontend-storage-secret-token(medium): A token, JWT, password or API key is stored in localStorage or sessionStorage, readable by any script on the page.graphql-batching-unbounded(medium): GraphQL query batching is enabled without a batch size, query depth, or cost/complexity limit.graphql-introspection-enabled(medium): A GraphQL server explicitly enables schema introspection.graphql-query-depth-unbounded(medium): A GraphQL server accepts queries of any depth.hardcoded-secret(critical): The source supplies a literal credential or cryptographic secret.insecure-cipher(medium): A cryptographic operation selects an insecure cipher or mode.insecure-deserialization(critical): Request data is deserialized by a library that can rebuild and run functions from it.insecure-random-for-secret(high): A sensitive token or secret uses a non-cryptographic random source.js-yaml-unsafe-schema(high): A resolved js-yaml loader enables JavaScript-specific YAML constructors.jsx-javascript-url(high): In React 18 and older or Preact, a URL search parameter or location hash starts a JSX href, action or iframe src (javascript: XSS).jwt-decode-for-auth(high): Authentication uses decoded JWT claims without verifying the token signature.jwt-none-algorithm(critical): JWT signing or verification allows an unsigned token.jwt-sign-without-expiry(medium): A signed JWT has no explicit expiration.jwt-verify-without-algorithms(high): JWT verification does not restrict the accepted signing algorithms.jwt-weak-secret-literal(high): JWT signing or verification uses a short (< 32 chars) or weak literal secret susceptible to brute-force forgery.knex-raw-dynamic-text(critical): A dynamic SQL fragment reaches Knex without parameter binding.kubernetes-privileged-container(high): A Kubernetes workload explicitly requests a privileged container.kysely-scope-unverified(high): A Kysely read lacks the row scope required by the declared policy.ldap-filter-injection(high): Request data reaches an LDAP search filter without RFC 4515 filter escaping or a filter builder.mass-assignment(high): An unfiltered request body reaches a persistence operation.mysql-dynamic-query-text(critical): Dynamic SQL text reaches a MySQL client without parameter binding.nest-validation-without-whitelist(medium): A NestJS ValidationPipe permits properties outside the validated DTO.next-image-any-remote-host(medium): A Next.js images.remotePatterns entry sets hostname ’**’, so the image optimizer fetches and serves any host (open proxy).nosql-operator-injection(high): Request data can introduce query operators into a NoSQL filter.open-redirect(medium): An HTTP redirect destination is controlled by request data.password-hash-in-response(high): A response returns a user record that still holds its password hash.path-traversal(high): Request data controls a filesystem path without a recognized containment check.pg-dynamic-query-text(medium): Dynamic SQL text reaches the PostgreSQL client without parameter binding.plaintext-password-storage(critical): A password is stored or written without being hashed.postmessage-missing-origin-check(medium): postMessage targets ’*’, or a window message listener reads event.data without checking origin or source.prisma-raw-unsafe-dynamic(critical): Dynamic SQL text reaches an unsafe Prisma raw-query method.prisma-scope-unverified(high): A Prisma operation lacks the row scope required by the declared policy.prototype-pollution(high): Request data can supply keys to a write or merge that can modify an object prototype.raw-content-disposition-filename(medium): Request data is interpolated into a raw Content-Disposition filename parameter.react-dangerously-set-inner-html(high): dangerouslySetInnerHTML receives HTML that is not a constant or sanitized.reflected-xss-response(low): An HTML response reflects request data without recognized escaping.regex-catastrophic-backtracking(high): A regular expression that can backtrack exponentially or in polynomial time runs on request input.regex-from-input(medium): Request input supplies a regular expression pattern without recognized escaping.request-selected-executable(high): Request input selects the program at a resolved process-launch API.secret-compared-non-constant-time(medium): A secret is compared with an operation that can vary in timing with its contents.secret-in-log(high): A log statement can expose a credential, token, or other secret.secret-in-url-query(medium): A password, token or API key is passed in a URL query string.sequelize-dynamic-query-text(critical): Dynamic SQL text reaches Sequelize without parameter binding.server-action-missing-auth(high): An exported Next.js Server Action performs work without verifying authentication or session state.ssrf-redirect-bypass(high): An outbound HTTP request with a dynamic URL does not disable redirects, allowing SSRF allowlist bypasses.ssrf-request-url(high): Request data controls the destination of a server-side network request.storage-object-public-acl(high): A storage upload makes the object publicly readable.template-autoescape-disabled(medium): A template engine is configured to render values without HTML escaping.template-injection(critical): Request data is interpreted as template source rather than a template value.template-raw-html-binding(medium): A Vue or Svelte template inserts a dynamic value as raw HTML.tls-verification-disabled(high): A TLS client skips certificate or server hostname verification.trust-boundary-violation(medium): Request data is stored in application-wide state that later requests trust.typeorm-dynamic-query-text(critical): A dynamic SQL fragment reaches TypeORM without parameter binding.upload-client-filename(medium): A file upload is stored under the original name supplied by the client.vm-sandbox-escape(critical): Nodevmorvm2executes dynamic code or an untrusted context, risking sandbox escape and host RCE.vue-v-html-unsanitized(high): A Vue render function binds unsanitized dynamic HTML to innerHTML.weak-hash(medium): A request credential is hashed with MD5 or SHA-1.weak-password-hash(high): A password is hashed with an algorithm unsuitable for password storage.webhook-body-without-verification(high): A Stripe webhook writes request-body data before visible signature verification.xml-external-entities(medium): An XML parser allows processing of external entities.xpath-injection(high): Request data is concatenated into an XPath expression.zip-slip-extraction(high): An archive entry controls an extraction path without a recognized containment check.
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.
csharp-binaryformatter-request-deserialization(high): Legacy BinaryFormatter.Deserialize consumes an ASP.NET Core request stream.csharp-ef-from-sql-raw(high): FromSqlRaw or ExecuteSqlRaw receives a concatenated or interpolated string, risking SQL injection.csharp-process-start(medium): Process.Start launches an external process and risks command injection with untrusted arguments.go-exec-command-shell(high): exec.Command invokes a shell, which risks command injection.go-sql-sprintf-injection(high): SQL text formatted with fmt.Sprintf risks SQL injection.go-tls-insecure-skip-verify(high): Setting InsecureSkipVerify: true on tls.Config disables TLS certificate verification.java-des-cipher(medium): A JCA Cipher factory explicitly selects DES.java-objectinputstream-request-deserialization(high): Java ObjectInputStream.readObject consumes a servlet request body.java-runtime-exec(medium): Runtime.getRuntime().exec runs an OS command and risks command injection with untrusted arguments.java-sql-string-concat(high): A SQL query built by string concatenation risks SQL injection.python-insecure-deserialization(high): pickle or marshal deserialization of untrusted data can execute arbitrary code.python-requests-tls-verify-disabled(high): Calling Python requests with verify=False disables TLS certificate verification.python-sqlite-unbound-value(medium): A Python sqlite3 query inserts a value into SQL text instead of binding it.python-subprocess-shell-true(high): subprocess with shell=True or os.system passes input through a shell, risking command injection.python-unsafe-yaml-load(high): yaml.load or yaml.load_all without SafeLoader or BaseLoader can construct arbitrary Python objects.rust-command-shell(high): Command::new(“sh”) or Command::new(“bash”) spawns a shell and risks command injection.rust-reqwest-danger-accept-invalid-certs(high): Calling danger_accept_invalid_certs(true) on a reqwest client disables TLS certificate verification.rust-unsafe-raw-pointer-deref(medium): A raw pointer dereference in an unsafe block bypasses Rust memory safety guarantees.
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.
dependency-known-vulnerability(medium): A resolved dependency version is listed in a published vulnerability advisory.
Project-defined row scopes
Row-scope checks readprismaScopes, 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. SetLOADWISE_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.