Skip to content

Commit 061e504

Browse files
authored
Merge pull request #126 from jagerman/reject-legacy-unblinded
Fix unblinded legacy auth
2 parents 2ddaf9b + feffb67 commit 061e504

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sogs/routes/legacy.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from flask import abort, request, jsonify, g, Blueprint
1+
from flask import abort, request, jsonify, g, Blueprint, Response
22
from werkzeug.exceptions import HTTPException
33
from ..web import app
44
from .. import crypto, config, db, http, utils
@@ -68,6 +68,10 @@ def legacy_check_user_room(
6868
if not pubkey or len(pubkey) != (utils.SESSION_ID_SIZE * 2) or not pubkey.startswith('05'):
6969
app.logger.warning("cannot get pubkey for checking room permissions")
7070
abort(http.BAD_REQUEST)
71+
if config.REQUIRE_BLIND_KEYS and pubkey.startswith('05'):
72+
msg = "Invalid authentication: this server requires the use of blinded ids"
73+
app.logger.warning(msg)
74+
abort(Response(msg, status=http.BAD_REQUEST, mimetype='text/plain'))
7175

7276
if room is None:
7377
if room_token is None:

0 commit comments

Comments
 (0)