Home > Mobile >  Can I use codeql to extract all regular expressions for a ruby project?
Can I use codeql to extract all regular expressions for a ruby project?

Time:12-28

.

this is the closest what I found but this returns part of regex and it do not return all of regex is ther any way to archive this even without 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   "'."

CodePudding user response:

You could try using RegExpLiteral instead of RegExpTerm.

  • Related