我正在使用Codeigniter PHP 框架。在其中一个配置文件中,您可以设置允许的 URL 字符:
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
因此,如果我尝试访问此网址:website.com/controller/%22quotedString%22,除非我在允许的字符上附加引号,否则我会收到错误消息:
$config['permitted_uri_chars'] .= '"';
我的应用程序实际上需要在 URL 中允许所有奇怪的字符,但我不希望有一个巨大的硬编码字符列表。Codeigniter 警告不要允许所有字符:
/* |-------------------------------------------------------------------------- | Allowed URL Characters |-------------------------------------------------------------------------- | | As a security measure you are STRONGLY encouraged to restrict URLs to | as few characters as possible. By default only these are allowed: a-z 0-9~%.:_- | | Leave blank to allow all characters -- but only if you are insane. | | DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!! | */
他们没有确切说明允许所有字符的安全问题。那么有哪些问题呢?