代码之家  ›  专栏  ›  技术社区  ›  chigley

@URL中允许字符,危险吗?

  •  1
  • chigley  · 技术社区  · 14 年前

    从CodeIgniter config.php文件:

    /*
    |--------------------------------------------------------------------------
    | Allowed URL Characters
    |--------------------------------------------------------------------------
    |
    | This lets you specify with a regular expression which characters are permitted
    | within your URLs.  When someone tries to submit a URL with disallowed
    | characters they will get a warning message.
    |
    | 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!!
    |
    */
    $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
    

    我加上 @

    谢谢

    6 回复  |  直到 14 年前
        1
  •  1
  •   Haim Evgi    14 年前
        2
  •  3
  •   Anti Veeranna    14 年前

    除此之外,这种安全检查有点。。哑巴,有越来越多的顶级域名使用除ASCII以外的字符,俄罗斯被分配,中国大陆得到,有更多的例子。

    http://en.wikipedia.org/wiki/Internationalized_domain_name

        3
  •  1
  •   J-16 SDiZ    14 年前

    此处未列出防止此类url:

    http://mybank.com-some-very-long-string@hacker.com/
    

    hacker.com mybank.com 去随便的苏联。

        4
  •  1
  •   Rafe Kettler    14 年前

    你不应该,除非你把它编码。未编码的 @

    所以,不管诱惑是什么,都不要做。你为什么要这么做?

        5
  •  1
  •   bcosca    14 年前

    A-Za-z0-9_\-\.!~*\'"(), (不是查询部分)

        6
  •  -1
  •   Bhushan Pawar    10 年前