False positive: Full server-side request forgery
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu với truy vấn py/full-ssrf và tái hiện các ví dụ Python đã được báo cáo bằng request.url.replace và urllib.parse.urljoin. So sánh các cảnh báo của chúng với ví dụ nối chuỗi đã được chấp nhận, sau đó xác minh rằng các biện pháp giảm thiểu hợp lệ cho việc xây dựng URL được nhận diện mà không loại bỏ các phát hiện SSRF thực sự.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description of the false positive
I have seen alerts for "Full server-side request forgery" (id: py/full-ssrf), even though the code has a valid mitigation in place. CodeQL also isn't recognizing other valid mitigations for this vulnerability.
For example, given this code:
url = request.url.replace(request.host_url, "my-expected-host-url")
resp = requests.request(
url=url,
)
As you can see, this code is already using request.url.replace to control the requested URL and ensure that malicious requests cannot manipulate the destination of the request. However, CodeQL does not recognize this method as a valid mitigation for SSRF.
I also tried:
from urllib.parse import urljoin
url = urljoin("my-expected-host-url", request.path)
CodeQL does not accept this approach either.
The only approach that CodeQL accepts is string concatenation:
url = "my-expected-host-url" + request.path
Having to use string concatenation instead of urljoin is not ideal.
- Ngôn ngữ chính
- CodeQL
- Star
- 10.1k
- Fork
- 2.1k
- Merge trung bình
- 2 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 134
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của github/codeql
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
C#: cs/simplifiable-boolean-expression false positive on Nullable<bool> compared with a literal Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
false-positive
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
false-positive
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
Tất cả issue của github/codeql
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
sipyourdrink-ltd/bernstein#6191 ·
-
security severity:low track:open-source
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
[addtool] DeepZero Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
gwen001/offsectools_www#2055 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
WalletConnect/actions#112 ·