path-traversal-anti-pattern

Detect path traversal vulnerabilities in file path manipulation logic.

8|1|Updated Jan 19, 2026
One-click install
npx skills add https://github.com/igbuend/grimbard --skill path-traversal-anti-pattern
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: path-traversal-anti-pattern
Source: https://github.com/igbuend/grimbard/tree/main/skills/path-traversal-anti-pattern
Command: npx skills add https://github.com/igbuend/grimbard --skill path-traversal-anti-pattern

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill protects applications from attackers who exploit vulnerabilities in file path handling to access or modify files outside of the intended directory.

Core Features & Use Cases

  • Vulnerability Detection: Identifies insecure code patterns where user input is directly concatenated into file paths.
  • Secure Coding Guidance: Provides clear "BAD" and "GOOD" code examples demonstrating how to validate and sanitize file paths.
  • Use Case: When reviewing code that handles file uploads or serves static content, use this Skill to ensure that user-provided filenames cannot be manipulated to access sensitive system files.

Quick Start

Review the current directory for path traversal vulnerabilities.

Frequently Asked Questions about path-traversal-anti-pattern

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent path traversal attacks in file handling code?

Detect path traversal vulnerabilities by analyzing file path manipulation logic for insecure user input concatenation. Apply path canonicalization and input validation to secure file reads, writes, and static content serving.

What is a CWE-22 path traversal vulnerability?

A CWE-22 path traversal vulnerability occurs when user input is directly concatenated into file paths without validation. This allows attackers to manipulate filenames to access or modify sensitive system files outside the intended directory.

How do I secure file upload paths against directory traversal?

Secure file upload paths against directory traversal by validating user-provided filenames and applying path canonicalization. Review code handling file uploads to ensure user input cannot be manipulated to access system files.

Does static content serving require input validation to prevent file access exploits?

Static content serving requires input validation to prevent file access exploits. Analyze static serving logic to ensure user-provided filenames cannot be manipulated to traverse directories and access sensitive system files.

What is the best way to sanitize file paths from user input?

The best way to sanitize file paths from user input is combining input validation with path canonicalization. Avoid insecure concatenation of user input into file paths, using secure alternatives to ensure file access remains within intended directories.