Skip to content

Commit 187e204

Browse files
committed
Clear out sensitive fake headers from client
We use the header dict to pass on non-header information to the authentication plugins. Make sure an evil client isn't trying to sneak something in that hasn't been verified by us. Issue found by Kevin Rasmussen.
1 parent 417210f commit 187e204

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

websockify/websocketproxy.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ def auth_connection(self):
6060
if not self.server.auth_plugin:
6161
return
6262

63+
# clear out any existing SSL_ headers that the client might
64+
# have maliciously set
65+
ssl_headers = [ h for h in self.headers if h.startswith('SSL_') ]
66+
for h in ssl_headers:
67+
del self.headers[h]
68+
6369
try:
6470
# get client certificate data
6571
client_cert_data = self.request.getpeercert()

0 commit comments

Comments
 (0)