n4o847 / seccamp-redos

A tool for detecting ReDoS vulnerabilities based on automata theory.
https://n4o847.github.io/seccamp-redos/
7 stars 4 forks source link

正しいIDA検出に修正 #23

Closed masa5555 closed 3 years ago

masa5555 commented 3 years ago
// (\w|\d)* has IDA?:  { status: 'Safe', message: "Don't have IDA." }
// [a-z][0-9a-z]* has IDA?:  { status: 'Safe', message: "Don't have IDA." }
// a[a-z] has IDA?:  { status: 'Safe', message: "Don't have IDA." }
// a*a* has IDA?:  { status: 'Vulnerable', message: 'Detected IDA.' }
// (.*)="(.*)" has IDA?:  { status: 'Vulnerable', message: 'Detected IDA.' }

3つの状態の直積を作るところが間違っていました。

n4o847 commented 3 years ago

かなりすっきりしていいと思います!

n4o847 commented 3 years ago

あ、approve したあとで思ったんですが、直積の順番が SCC1 → NFA → SCC2 となっているのに対して、Builder に与える順番が SCC1 → SCC2 → NFA となっているのがちょっと非直感的な気がしました(遅かった……)

yapatta commented 3 years ago

確かに、 scc1, nfa, scc2の方が直感的(定義と書き方が揃えられる)

masa5555 commented 3 years ago

なるほど。直接直しちゃっても良いですかね?

n4o847 commented 3 years ago

お願いします、このブランチ restore しましょう

n4o847 commented 3 years ago

あれ、Restore branch して以降の変更ってこのプルリクに組み込めるんだっけ

無理そうだったら何でも良いです

masa5555 commented 3 years ago

詳しくないので、自分もわかりませんが、できなそうですね。新しく立てて、mergeします