In which languages is it a security hole to use user-supplied regular expression?

后端 未结 8 1503
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-17 17:00

Edit: tchrist has informed me that my original accusations about Perl\'s insecurity are unfounded. However, the question still stands.

I know that i

8条回答
  •  再見小時候
    2020-12-17 17:29

    1)Vulnerabilities are found in regex libraries, such as this buffer overflow that affects Webkit and allows any attacker to gain remote code execution by accessing the regex library from javascript.

    2)It is a DoS condition in C#.

    3)User supplied regex's can be for php because of modifiers. Adding the /e modifier evals the match. In this case system will be eval()'ed.

    preg_replace("/.*/e","system('echo /etc/passwd')");

    Or in the form of a vulnerability:

    preg_replace($_GET['regex'],$_GET['check']);

提交回复
热议问题