Websocket proxy auth truncates passwords that contain a colon
Maintainer antworten meist innerhalb von 1 Tag
@Akshaay1 arbeitet bereits daran.
Seit 13.10.2026.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 86/100
Rechercherichtung
Beginne in kubernetes/stream/ws_client.py bei der Aufteilung der Zugangsdaten um Zeile 602 und prüfe anschließend die Tests in der Nähe für websocket_proxycare. Reproduziere den Fehler mit dem bereitgestellten Snippet, einschließlich eines password, das Doppelpunkte enthält, und fehlerhafter Zugangsdaten. Fertig ist die Arbeit, wenn das vollständige password erhalten bleibt und fehlerhafte Header keinen ungefangenen IndexError mehr auslösen, und Tests beide Fälle abdecken.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
What happened (please include outputs or screenshots):
While testing an experimental version of Perch, we found the following and figured it was worth a report.
websocket_proxycare splits the decoded proxy-authorization credentials on every : and keeps only the first two parts. A proxy password that contains a colon is cut off, so websocket calls (stream for exec, attach and port-forward) through an authenticated proxy send the wrong password.
import base64
from types import SimpleNamespace
from kubernetes.stream.ws_client import websocket_proxycare
cred = base64.b64encode(b"alice:pa:ss:word").decode()
cfg = SimpleNamespace(no_proxy=None, proxy="http://proxy:3128",
proxy_headers={"proxy-authorization": "Basic " + cred})
print(websocket_proxycare({}, cfg, "wss://h", {})["http_proxy_auth"])
# ('alice', 'pa')
The same code raises IndexError: list index out of range when the header is just Basic, or when the decoded value has no colon.
What you expected to happen:
('alice', 'pa:ss:word'). RFC 7617 allows colons in the password; only the user-id can't contain one.
How to reproduce it (as minimally and precisely as possible):
Run the snippet above against master. No cluster is needed.
Anything else we need to know?:
The split is at kubernetes/stream/ws_client.py:602:
auth = urlsafe_b64decode(b64value).decode().split(':')
connect_opt.update({'http_proxy_auth': (auth[0], auth[1]) })
split(':', 1) would keep the full password.
Environment:
- Kubernetes version (
kubectl version): not needed, no cluster involved - OS (e.g., MacOS 10.13.6): macOS 26.2 (arm64)
- Python version (
python --version): 3.14.2 - Python client version (
pip list | grep kubernetes): 37.0.0+snapshot (master, bb9199f7)
- Vorherrschende Sprache
- Python
- Sterne
- 7.7k
- Forks
- 3.5k
- Ø Merge
- 1 T. 9 Std.
- Gemergte PRs (30 T.)
- 22
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus kubernetes-client/python
-
getheaders is deprecated in urllib3 >= 2.0.0Evtl. wieder frei Ein Pull Request dazu wurde ohne Merge geschlossen. Offenkind/bug
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 68/100
kubernetes-client/python#2280 · 16 Kommentare · 9 Reaktionen ·
Maintainer antworten meist innerhalb von 1 Tag
-
Make async an extraOffenkind/feature
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 55/100
kubernetes-client/python#2739 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
kind/bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 35/100
kubernetes-client/python#2733 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Growing library sizeOffenhelp wanted
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
kubernetes-client/python#2677 · 15 Kommentare · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
Add option to disable strict x509 verifcation in sync clientEvtl. vergeben @Vishwa0223 hat das vor 51 Tagen übernommen. Offenhelp wanted kind/feature
kubernetes-client/python#2602 · 6 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in kubernetes-client/python
Ähnliche Issues
-
good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
btclib-org/btclib-node#1955 ·
Maintainer antworten meist innerhalb von 1 Tag
-
documentation v0.9.2
Schwierigkeit 2/5 Ein halber Tag Anfängerfreundlichkeit 72/100
khuisman/mcp-gee-sweet#1033 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
ossf/cve-bin-tool#5966 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
Maintainer antworten meist innerhalb von 2 Tagen
-
write_iceberg ignores the table's write.parquet.compression-codec propertyEvtl. vergeben @YuangGao hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Eventual-Inc/Daft#7606 ·
Maintainer antworten meist innerhalb von 1 Tag