Can $_SERVER['REMOTE_USER'] be spoofed?

放肆的年华 提交于 2020-01-22 19:51:06

问题


I have a situation where I am opening a file based on the $_SERVER['REMOTE_USER'] variable. I don't think this is spoof-able but would just like to confirm. I do not want to make myself vulnerable to the reading of arbitrary files:

   <?
      $user = $_SERVER['REMOTE_USER'];
      $fp = fopen("./$user.png","r");
   ?>

回答1:


Yes, that username is whatever is specified by the remote user.

You need to verify password as well. If password is verified by your server, and not your application, then you are probably okay.



来源:https://stackoverflow.com/questions/12942065/can-serverremote-user-be-spoofed

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!