[原文]Directory traversal vulnerability in lstat.cgi in LinuxStat before 2.3.1 allows remote attackers to read arbitrary files via (1) .. (dot dot) sequences or (2) absolute paths to the template parameter.
It is reported that LinuxStat is vulnerable to a directory traversal vulnerability. This issue is due to a failure of the application to properly sanitize user-supplied input.
By including '../' directory traversal sequences in the affected URI argument, attackers may reportedly cause the contents of arbitrary, potentially sensitive web-server readable files to be included in the output of the requested page. The resulting information disclosure may aid malicious users in further attacks.
Versions prior to 2.3.1 are reported to be affected by this vulnerability.
LinuxStat contains a flaw that may lead to an unauthorized information disclosure. The issue is due to the template parameter of lstat.cgi not being properly validated, which allows the reading of arbitrary files, resulting in a loss of confidentiality.
Upgrade to version 2.3.1 or higher, as it has been reported to fix this vulnerability. It is also possible to correct the flaw by implementing the following workaround(s):
1) Block access to computer statistics.
2) If "Username/Password" access to computer statistics is being used then a change of passwords is suggested.
3) Modify the Misc.pm file in the lib folder by adding the following line to it:
$TemplateFile =~ s/\.\.//g;
The above line should be placed in the vicinity of line 270, BEFORE the following code:
open (FILE, "<$TemplateFile" ) || croak "Can't open template file $TemplateFile: $! \n";
my @content = <FILE>; #load content template into memory