github / github/codeql

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

未关闭
#21,666 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
CodeQL
星标
10.1k
派生
2.1k
平均合并
2 天 15 小时
30 天内合并 PR
141

描述

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')
```

贡献指南

打开贡献指南

调研方向

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.

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
security
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。