Home / Vulnerability Database / Perl : Two-argument open function usage
Perl
Perl : Two-argument open function usage
Classification
OWASP Top 10 2013
OWASP Top 10 2017
OWASP Top 10 2021
PCI DSS 4.0
CWE/SANS Top 25 2011
Overview
The application uses the open function with two arguments, which is unsafe.
There are several forms of the open function:
open FILEHANDLE,EXPRopen FILEHANDLE,MODE,EXPRopen FILEHANDLE,MODE,EXPR,LISTopen FILEHANDLE,MODE,REFERENCEopen FILEHANDLE
The MODE argument is responsible for the mode in which the file will be opened (for input or output). It can also be used to indicate that instead of opening a file, the system must execute the command shell and treat it as an input or output file.
When using the open function with two arguments, you need to pass the mode in which you want to view the file with the name of the file you want or the corresponding command shell as EXPR. This function form is much more prone to errors and may lead to command injection if the user can influence the variable responsible for the file name.
MEDIUM
DerScanner Severity Score
Do you want to fix Perl : Two-argument open function usage in your application?
See also
Perl
Perl : Empty encryption key
Perl
Perl : Undocumented feature: special account
Perl
