Fix GuideInput Validation

How to Fix CWE-22: Path Traversal

Verified by Precogs Threat Research

The application uses user input to construct file paths without preventing directory traversal sequences (../).

⚠️ Impact if Unpatched

Arbitrary file read/write, source code disclosure, configuration exposure, potential code execution.

Step-by-Step Remediation

  1. Canonicalize file paths and verify they remain within the intended directory
  2. Use a chroot or jail for file operations
  3. Reject any input containing path traversal sequences (../, ..\.)
  4. Map user input to an index/ID rather than using it directly as a filename
  5. Implement proper access controls on the filesystem level

Don't just patch one instance.

Scan your entire codebase for all instances of Path Traversal.

Scan for Free with Precogs AI →

Recent Vulnerabilities (CWE-22)

63 vulnerabilities in our database match Path Traversal.

View all 63 vulnerabilities →