Sanitize file path in PHP

后端 未结 7 1058
夕颜
夕颜 2020-12-01 11:00

Greetings, I\'m hoping to make my tiny program secure so that potential malicious users cannot view sensitive files on the server.

    $path = \"/home/gsmcm         


        
7条回答
  •  栀梦
    栀梦 (楼主)
    2020-12-01 11:08

    There is an additional and significant security risk here. This script will inject the source of a file into the output stream without any server-side processing. This means that all your source code of any accessible files will be leaked to the internet.

提交回复
热议问题