github / github/codeql

[Java] Dataflow through object

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

説明

Hello,

I am getting some false positives with some of my queries, which are usually centered around a source node flowing into an object and then other data from that object flowing into a sink node.

Here is a simple example,

```
env.put(Context.SECURITY_CREDENTIALS, password);
LOG.error("connection error [{}], failover connection to [{}]", env.get(Context.PROVIDER_URL), this.ldapURI.toString());
```
In this case, `password` is a source variable. While `LOG.error` is a sink. However, by having it flow into `env`, it now marks any use of the object as a detection eventough this case has nothing to do with `password`. Is there any way to reduce cases like this?

Thank you

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

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

調査の方向性

例で説明されている Java のデータフローの挙動から始め、特に `password` から `env` へのフローと、その後のそのオブジェクトからの読み取りに注目してください。オブジェクトレベルのフローがどのようにモデル化されているかを確認し、無関係な `env` の値がロギングシンクに到達しない、焦点を絞ったリグレッションケースを定義してください。

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

評価

技術スタック
java
領域
security
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

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

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