Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Websocket proxy auth truncates passwords that contain a colon

Geschlossen Anfängerfreundlich
#2,734 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@Akshaay1 arbeitet bereits daran.

Seit 13.10.2026.

  • #2738 von @Akshaay1 — offen
  • #2740 von @tilakraj-hub — ohne Merge geschlossen

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
86/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
python
Bereich
backend

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

help wanted

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

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus kubernetes-client/python

Alle Issues in kubernetes-client/python

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.