swagger-api/swagger-js

Fix code scanning alert - Polynomial regular expression used on uncontrolled data

char0n opened this issue · 4 comments

Fully safe regexp: /\{([^{}]+)}|([^{}]+)/g

  while ((text = re.exec(str))) {
    if (text[1]) results.push(text[1]);
  }
  return results;

The issue was mitigated in #3502

The issue was fully remediated in #3507