Skip to content
vetkitChecksChangelogDocumentation

vetkit.ruby.path-traversal.file-access

A file path used to read, write, send or delete a file comes from request input (path traversal). Attackers can use ../ sequences or absolute paths to reach other files.

Last updated:

Suite: Security

ruby

A file path used to read, write, send or delete a file comes from request input (path traversal). Attackers can use ../ sequences or absolute paths to reach other files.

Category: SECURITY · Engine rule severity: ERROR

How to fix it

Reduce the value to a file name with File.basename, look it up through a database record, and check that File.expand_path stays inside the intended directory.

References

Source: packages/engine/rules/sast/ruby.yml.

Generated from shipped rule definitions at build time. Matching is a review signal, not proof of exploitability. “generic” denotes text matching, not complete language or framework coverage. Runtime configuration and available tools affect whether a rule runs.