github / github/codeql

False positive: Ruby: Kernel Open when File existence guard is present

オープン
#16,943 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
false-positive
主要言語
CodeQL
スター
10.1k
フォーク
2.1k
平均マージ
2日 15時間
マージ済み PR(30日)
141

説明

**Description of the false positive**

When `IO.read` is guarded by a check like `File.exists?`, isn't that a valid guard against injecting the `|` character into `Kernel.open`? I don't imagine that many systems out there have files lying around named `|.txt`.

**Code samples or links to source code**

https://github.com/github/codeql/blob/81593ece5aa7701ec0b103932f84ff65ae506e0b/ruby/ql/lib/codeql/ruby/security/KernelOpenQuery.qll#L83C1-L87

**URL to the alert on GitHub code scanning (optional)**
- https://github.com/Chainguard-Wolfi-Bites-Back/opensearch-project__logstash-output-opensearch/security/code-scanning/2
- https://github.com/opensearch-project/logstash-output-opensearch/blob/4221dffef4c1d9fd5ded5ae726ef2874fdd9ba5b/lib/logstash/outputs/opensearch/template_manager.rb#L55-L59

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

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

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