py/insecure-protocol missing urllib3 ssl_version tracking & false positive on secure defaults
- Lingua principale
- CodeQL
- Stelle
- 10.1k
- Fork
- 2.1k
- Merge medio
- 2g 15h
- PR unite (30g)
- 141
Descrizione
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')
```
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- security
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 48/100