github / github/codeql

Missing taint flow

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

説明

**Description of the false positive**

**Code samples or links to source code**

**URL to the alert on GitHub code scanning (optional)**

I use the following query analysis code:
```

import python
import semmle.python.dataflow.new.DataFlow
import semmle.python.dataflow.new.TaintTracking
import semmle.python.dataflow.new.RemoteFlowSources
import semmle.python.Concepts
import semmle.python.ApiGraphs
module BackwardDataFlowConfiguration implements DataFlow::ConfigSig {
predicate isSource(DataFlow::Node source) {
source instanceof DataFlow::ExprNode
and source.asExpr() instanceof Name
and source.getLocation().getFile().getRelativePath() = "lollms/server/endpoints/lollms_personalities_infos.py"
and exists(Name n |
n = source.asExpr() and n.getId() = "category")

and source.getLocation().getStartLine() = 330

}

predicate isSink(DataFlow::Node sink) {
sink instanceof DataFlow::Node
}
}

module BackwardDataFlow = TaintTracking::Global;

from DataFlow::Node begin, DataFlow::Node end
where BackwardDataFlow::flow(begin, end)
select
begin,
"$@,$@"
,
begin.getLocation(),
"begin location"
,
end.getLocation(),
"end location"

```
this is the results:
![Image](https://github.com/user-attachments/assets/fc7ece80-4026-47e4-9bf7-3859ed222560)
Starting from the `category` variable I specified, I tried to find all the nodes that it could potentially flow to. However, I only ended up with six results, which are marked in the figure above. Apparently, the `package_full_path` in the row where the sixth point is located is also a node that category could flow to, but the results don't reflect this. Why is that? Thank you for your answer!

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

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

調査の方向性

提供された CodeQL クエリと、330 行目のソース位置 lollms/server/endpoints/lollms_personalities_infos.py から始めます。category のフロー結果を再現し、次に package_full_path を含む位置を調べて、報告されたノードと比較します。その位置が結果に含まれていない理由を説明するか、必要な修正を特定できれば完了です。

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

評価

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

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

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