Skip to content

Correct Regex for Insecure Random

Fern requested to merge fjdiaz-main-patch-22529 into main

What does this MR do?

Corrects the regex for insecure random usage. Currently "^(next|random)" fails because it tries to match the beginning of input. By removing the ^ it will just look for next or random in the appropriate position.

What are the relevant issue numbers?

Does this MR meet the acceptance criteria?

  • The test cases cover both positive and negative cases and are also annotated with appropriate semgrep annotations:
    • For positive cases: // ruleid: ...
    • For negative cases: // ok: ....
  • Following metadata fields exist for the rule(s) added/updated in this MR:
    • owasp with both 2017 and 2021 mappings.
    • category: "security"
    • cwe
    • shortDescription
    • security-severity
  • The message field is valid and contains a secure code example.
  • Applicable license is mentioned in the rule if embedded/taken from external source.
  • Relevant labels including workflow labels are appropriately selected.

Merge request reports