High severityRubySSRF & Path TraversalMEDIUM confidence
Path Traversal Tainted Input
Untrusted input flows into a filesystem read/serve call (File.read/open, IO.read, send_file, send_data), enabling path traversal and arbitrary file disclosure (CWE-22).
Standards mapping
- OWASP Top 10
- A01:2021 - Broken Access Control
- OWASP ASVS
- V12.3.1 (L1)
Vulnerable vs. safe
Flagged by this check
File.read(params[:file])Passes - the safe pattern
File.read(File.basename(params[:file]))Why it matters & how to fix it
Untrusted input flows into a filesystem read/serve call (File.read/open, IO.read, send_file, send_data), enabling path traversal and arbitrary file disclosure (CWE-22). Resolve the path with File.expand_path and confirm it stays within an intended base directory, or map input to a fixed allow-list of file identifiers.
References
Rule ID integsec-ruby-path-traversal-taint - engine: Opengrep - license: MIT - Copyright (c) IntegSec Inc.
TurboPentest runs this check automatically
Connect a GitHub repo and this check runs on every white-box pentest - AI-validated and reported with proof, from $99 per target.
Start a pentestRelated checks
- JavaScript / TypeScript - SSRF & Path TraversalPath Join With Request
- JavaScript / TypeScript - SSRF & Path TraversalPath Traversal Tainted Input
- JavaScript / TypeScript - SSRF & Path TraversalSSRF Outbound Request Tainted Input
- Python - SSRF & Path TraversalPath Traversal
- Python - SSRF & Path TraversalSSRF HTTP Request
- Java - SSRF & Path TraversalPath Traversal Tainted Input