#6387·st2

Regular Expression Denial of Service (ReDoS) in check_processes action (CWE-400)

Author: jaredbischofCreated Jul 20, 2026Updated Jul 20, 2026

Summary

Static analysis (Snyk SAST) identified a Regular Expression Denial of Service (ReDoS) vulnerability where unsanitized user input from command line arguments is passed directly to re.search without validation.

Affected File

contrib/linux/actions/checks/check_processes.py (line 73)

python
def byName(self, name):
    self.name = name
    self.process(criteria="name")
    self.show()

The name parameter is set from CLI input and later used in re.search at line 73:

python
if re.search(self.name, pInfo[1]):
    self.interestingProcs.append(pInfo)

Impact

A user-supplied process name is used directly as a regular expression pattern. A crafted input string with pathological backtracking patterns (e.g., (a+)+$) could cause the regex engine to consume significant CPU time, effectively causing a denial of service.

While this is contrib code, it ships with StackStorm and may be deployed by users without modification.

Recommended Fix

If regex matching is intentional, sanitize the input or set a timeout. If literal string matching is sufficient, use a simple string comparison instead of re.search:

python
# Option 1: Escape regex special characters for literal matching
if re.search(re.escape(self.name), pInfo[1]):

# Option 2: Use simple string containment check
if self.name in pInfo[1]:

References

  • CWE-400: Uncontrolled Resource Consumption
  • Detected by: Snyk Code (SAST)