The following code is written in the php
template:
function langs($a) { $type_lang = $_GET['lang']; eval(file_get_contents("system/langs/$ type_lang.txt ")); return $worlds[$a]; }
Could he be dangerous with anything?
The following code is written in the php
template:
function langs($a) { $type_lang = $_GET['lang']; eval(file_get_contents("system/langs/$ type_lang.txt ")); return $worlds[$a]; }
Could he be dangerous with anything?
Can. If the villain is aware of the device, and can somehow upload a text file to the server, albeit in a different folder, then calling shablon.php?lang=../../uploads/ evil.txt
executes its code.
eval()
to load language strings is not the best solution. - SergiksAre you sure that your system does not have and never will appear any holes that allow you to write something to this very same $ type_lang.txt ?
If this happens, your script will immediately turn into a shell.
Conclusion: eval is safe only with static code inside
Source: https://ru.stackoverflow.com/questions/130484/
All Articles
$type_lang
consists only of letters and numbers. - ReinRaus