github / github/codeql

LGTM.com - false positive in path sanitization code

未關閉
#7,277 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
false-positive Java
主要語言
CodeQL
星號
10.1k
分支
2.1k
平均合併
2 天 15 小時
30 天內合併 PR
141

描述

In order to provide path sanitization for some of API controllers used in OpenGrok (reported by both Sonar and LGTM), a change was made to verify the path supplied in the request does not point to outside the expected directory tree:
https://github.com/oracle/opengrok/commit/5082f8ec5e11b8259d833bfd5e6749eb0030ddad#diff-4357c5e759897ec6f09fb7ef09c661bf2719fda58ed0155d2737380a5fd5aee4

Even though this was changed according to the recommendations on https://snyk.io/research/zip-slip-vulnerability , LGTM still reports this as *Uncontrolled data used in path expression* problem in the method that actually performs the sanitization.

The LGTM URL for this alert is https://lgtm.com/projects/g/oracle/opengrok/snapshot/ed926a38faaf0796db709bf2ad62f8c4204690c1/files/opengrok-web/src/main/java/org/opengrok/web/util/FileUtil.java?sort=name&dir=ASC&mode=heatmap#x96d75c2f94454f17:1

I believe this is false positive, however if someone believes this can be done in better way, I am open to suggestions.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

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

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