github / github/codeql

py/insecure-protocol missing urllib3 ssl_version tracking & false positive on secure defaults

Đang mở
#21,666 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
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ả

1. The analysis only inspects standard SSL and pyOpenSSL module constructors and fails to detect insecure ssl_version arguments passed to widely used libraries like urllib3.PoolManager.
2. It seems ssl.create_default_context() is incorrectly flagged as vulnerable; it is the best default for the client as per the doc.

```python
import ssl
import socket
from urllib3.poolmanager import PoolManager

sock = socket.socket()

# FN: use urllib3 PoolManager with explicit insecure ssl_version
pool_mgr = PoolManager(ssl_version=ssl.PROTOCOL_TLSv1)

# FP: https://docs.python.org/3/library/ssl.html#ssl-security
ctx = ssl.create_default_context()
ctx.wrap_socket(sock, server_hostname='example.com')
```

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

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

Hướng nghiên cứu

Start at the py/insecure-protocol query entry point and use the Python example to trace how SSL version arguments are detected. Confirm that urllib3.PoolManager with an insecure ssl_version is reported while ssl.create_default_context() is not, then add or update the relevant query tests.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
security
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
48/100

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.