我可以使用codeql提取ruby项目的所有正则表达式吗



这是我发现的最接近的,但它返回了regex的一部分,而不是返回所有的regex即使没有codeql,还有什么方法可以存档吗

import codeql.ruby.security.regexp.ExponentialBackTracking
import codeql.ruby.security.regexp.NfaUtils
import codeql.ruby.Regexp
from RegExpTerm t, string pump, State s, string prefixMsg
where hasReDoSResult(t, pump, s, prefixMsg)
select t,
"This part of the regular expression may cause exponential backtracking on strings " + prefixMsg +
"containing many repetitions of '" + pump + "'."

您可以尝试使用RegExpLiteral而不是RegExpTerm

最新更新