Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#6,387 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
python
領域
cli, security

調査の方向性

contrib/linux/actions/checks/check_processes.py の byName と 73 行目付近の re.search 呼び出しから始め、プロセス名がコマンドライン引数からどのように渡されるかを追跡します。一致判定を引き続き正規表現ベースにするべきか、リテラルにするべきかを判断し、そのうえで、細工した入力によって正規表現の過剰なバックトラッキングが発生しないこと、および通常のプロセス名の一致が引き続き機能することを確認します。

索引モデルが issue の本文から書いたものです。

説明

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)

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:

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:

# 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)
主要言語
Python
スター
6.5k
フォーク
792
平均マージ
1日 3時間
マージ済み PR(30日)
4

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

StackStorm/st2 のほかの issue

StackStorm/st2 の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。