github / github/codeql

False positive: MongoDB no sql injection

未關閉
#20,455 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
false-positive
主要語言
CodeQL
星號
10.1k
分支
2.1k
平均合併
2 天 15 小時
30 天內合併 PR
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
預估耗時
一週以上
活躍度
停滯
描述清晰度
需要釐清
新手友好度
30/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。