正規表現は過度に制限的であるため、危険な値が検出されない。
この弱点は正規表現の複雑さについてではない。むしろ、正規表現が意図したすべての値にマッチしないということです。許容される値を特定するため、あるいは、不要な用語を発見するために正規表現を使用することを考えてください。正規表現が過度に制限されていると、コードの中で正規表現がどのように使用されているかによって、セキュリ ティに関連する可能性のある値を見逃してしまい、偽陽性(false positive)または偽陰性(false negative)になってしまいます。例えば、/[0-8]/という表現を考えてみてください。 この式は「複雑」ではないが、プログラマーが「9」をチェックするつもりだったのかもしれないのに、「9」という値はマッチしない。
A regular expression is overly restrictive, which prevents dangerous values from being detected.
This weakness is not about regular expression complexity. Rather, it is about a regular expression that does not match all values that are intended. Consider the use of a regexp to identify acceptable values or to spot unwanted terms. An overly restrictive regexp misses some potentially security-relevant values leading to either false positives *or* false negatives, depending on how the regexp is being used within the code. Consider the expression /[0-8]/ where the intention was /[0-9]/. This expression is not "complex" but the value "9" is not matched when maybe the programmer planned to check for it.