SlopGradeby Maxor Global LLC
Sign inStart the free 14-day trial
Injection gate · CWE-22

Stop ../ from escaping your files directory.

When user input is joined into a file path with no normalization, a name like ../../etc/passwd escapes the intended directory. AI writes this in any "serve/download a file" feature. SlopGrade blocks it in CI, before merge.

CWE-22
Gate catalog
0
lines of source stored
MIT
open-source client — read every line
JS/TS · Python · Go · .NET
Languages
The bug

User input joined straight into a file path.

There is no resolve-and-check that the final path stays inside the base directory, so ../ segments walk out. Resolving and verifying the prefix fixes it — the gate blocks the un-checked join.

What the AI shipped

api/files.ts — user input in the path
fs.readFile('./files/' + req.params.name) // ../ escapes

What leaves your runner

CWE-22
{ "file": "api/files.ts", "line": 12, "kind": "path-traversal" }

Path, line, class. On a private repo the file content stays on the runner by default; the deep scan (heisen-slop) is a paid opt-in. Audit it with --print-payload.

How the gate catches it

Detect → adapt → verify. By default, nothing else leaves.

01 · DETECT

In your runner, on the diff

The open-source client walks the pull request and flags the pattern locally — intra-function dataflow. By default, no code leaves the machine.

→
02 · ADAPT

Server verdict + gate

The structural fingerprint is classified server-side. A hard hit blocks the check on a paid private repo; public repos are gated free; the paywall fails open.

→
03 · VERIFY

Posted inline, re-checked on push

The finding is posted on its exact line. For the few classes with a safe deterministic rewrite (TLS verification off, debug on, yaml.load…), a fix is generated AND verified in your runner; otherwise you fix it and the next push re-checks.

→
Questions teams ask

What makes a path join safe?

Resolving the path and asserting it still starts with the intended base directory (or using a fixed map of allowed names). The gate recognizes that check and passes it; the bare join is flagged.

Does it cover uploads too?

The write side (zip-slip, unrestricted upload paths) is covered by adjacent gate classes in the full firewall; this page's class is the read/serve traversal. See the full catalog for the rest.