Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Security .. (点)在URL中_Security_Http_Url - Fatal编程技术网

Security .. (点)在URL中

Security .. (点)在URL中,security,http,url,Security,Http,Url,考虑URL请求的web服务,如下所示: samplehost.com/here/comes/a/path 此应用程序将采用路径(behind.com)并查找具有相对于已定义本地目录的此路径的文件 因此,假设这个公共目录是/home/user/files,上面的URL将提供文件/home/user/files/here/comes/a/path 在写这篇文章时,我突然想到了这样一个问题:当有人请求URL时,会发生什么: samplehost.com/../secret curl和浏览器都无法发

考虑URL请求的web服务,如下所示:

samplehost.com/here/comes/a/path
此应用程序将采用路径(behind
.com
)并查找具有相对于已定义本地目录的此路径的文件

因此,假设这个公共目录是
/home/user/files
,上面的URL将提供文件
/home/user/files/here/comes/a/path

在写这篇文章时,我突然想到了这样一个问题:当有人请求URL时,会发生什么:

samplehost.com/../secret
curl和浏览器都无法发送此url。或者更确切地说,在这两种情况下,webapp都会收到一个删除点的路径:
secret


这一机制在哪里实施?为了避免出现这样的安全问题,我是否还需要在此处确定其他内容?

加载数据的应用程序必须确保仅加载公共目录中的数据。通过使用文件系统权限,还可以提高安全性


您不应该依赖客户端检查,因为它们依赖于使用过的客户端。黑客可以在HTTP请求中写入所有内容。

以防您不知道,您所询问的内容称为A。这听起来很合理。我现在明白了,这比在字符串级别检查要好得多。我不完全确定点删除是否由客户完成。看起来像。