SlopGradeby Maxor Global LLC
Sign inStart free
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
file content leaves CI
0
false positives · 5,000+ repos
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. The file content never leaves. Audit it with --print-payload.

How the gate catches it

Detect → adapt → verify. 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, 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, fix verified locally

The finding is posted on its exact line. Where a fix exists it is generated AND verified in your runner — only offered once a re-scan proves the issue is gone.

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.