Skip to content

Make path traversal containment check case-insensitive#646

Merged
bitterpanda63 merged 1 commit into
mainfrom
fix/case-insensitive-path-traversal
Jun 1, 2026
Merged

Make path traversal containment check case-insensitive#646
bitterpanda63 merged 1 commit into
mainfrom
fix/case-insensitive-path-traversal

Conversation

@bitterpanda63
Copy link
Copy Markdown
Member

@bitterpanda63 bitterpanda63 commented Jun 1, 2026

Makes the user-input containment check in path traversal detection case-insensitive, matching the fix applied to the Node.js firewall in AikidoSec/firewall-node#1047.

Problem: On case-insensitive filesystems (macOS APFS, Windows NTFS), an attacker can submit a path like /ETC/PASSWD which resolves to /etc/passwd. The detection check user_input not in file_path was case-sensitive, so /ETC/PASSWD would not be found in /etc/passwd and traversal would go undetected.

Fix: Changed user_input not in file_path to user_input.lower() not in file_path.lower().

See: AikidoSec/firewall-node#1047

Summary by Aikido

Security Issues: 0 Quality Issues: 0 Resolved Issues: 0

🐛 Bugfixes

  • Made path containment check case-insensitive to detect traversal attacks

More info

@bitterpanda63 bitterpanda63 merged commit 24bb970 into main Jun 1, 2026
169 of 178 checks passed
@bitterpanda63 bitterpanda63 deleted the fix/case-insensitive-path-traversal branch June 1, 2026 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants