github / github/codeql

False positive - Java - Server-side request forgery - When type converted to `File`

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

説明

**Description of the false positive**

If a `URI` or `URL` is created from a `File` it isn't a valid source of SSRF. This is because, AFAIK, opening a stream from a file will never create a socket request.

`new File("untrusted-user-input.txt").toURI().toURL().openStream()`

**Code samples or links to source code**

https://github.com/keycloak/keycloak/blob/0bfadacffd1112e6fa6fdce5b6662b08aeb15d79/services/src/main/java/org/keycloak/theme/FolderTheme.java#L101-L101

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

https://github.com/Chainguard-Wolfi-Bites-Back/keycloak__keycloak/security/code-scanning/18

**Reasonable Fix**

It should be simple to add any type conversion to a `File` as a simple sanitizer.

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

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

評価

この issue はまだ評価されていません。

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

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