False positive: MongoDB no sql injection
- 主要言語
- CodeQL
- スター
- 10.1k
- フォーク
- 2.1k
- 平均マージ
- 2日 15時間
- マージ済み PR(30日)
- 141
説明
CodeQL (go/sql-injection) flags it when user input flows into any MongoDB query methods, which is great. However, there doesn't seem to be a way to fix the alert at all. There's no specific recommendations for MongoDB.
I spent some time digging into how CodeQL does the detections and I tried to figure out if there's any barrier I could use to fix the alert, but no luck.
Encapsulating user input in `bson` and input sanitisation also do not help.
Note that we use GHAS, which uses CodeQL default suites. As far as I understand, there is no easy way to just override the rule and we don't want to manually close them.
コントリビューションガイド
調査の方向性
Start with the go/sql-injection query and its MongoDB query-method modeling; reproduce the reported flow using user input, bson wrapping, and sanitization. Done means the valid MongoDB case is no longer flagged, or the issue has a documented CodeQL/GHAS remediation path.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- go, mongodb
- 領域
- databases, security
- issue の種類
- バグ
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 30/100