github / github/codeql

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

Đang mở
#16,949 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
false-positive
Ngôn ngữ chính
CodeQL
Star
10.1k
Fork
2.1k
Merge trung bình
2 ngày 15 giờ
Pull request đã merge (30 ngày)
141

Mô tả

**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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.