Compare commits

...

3 Commits

Author SHA1 Message Date
Mohamed ElKalioby
2d7b80bf5a Fixing CVE-2022-42731 2022-10-10 17:35:26 +03:00
Mohamed ElKalioby
8dba66b7b2 Merge branch 'CVE-2022-42731' 2022-10-10 17:21:31 +03:00
Mohamed ElKalioby
54db5a513b Fixing CVE-2022-42731 2022-10-10 17:20:47 +03:00
3 changed files with 14 additions and 4 deletions

View File

@@ -1,4 +1,12 @@
# Change Log # Change Log
## 2.6.1
* Fix: CVE-2022-42731: related to the possibility of registration replay attack.
Thanks to 'SSE (Secure Systems Engineering)'
## 2.5.1
* Fix: CVE-2022-42731: related to the possibility of registration replay attack.
Thanks to 'SSE (Secure Systems Engineering)'
## 2.6.0 ## 2.6.0
* Adding Backup Recovery Codes (Recovery) as a method. * Adding Backup Recovery Codes (Recovery) as a method.
Thanks to @Spitfireap for work, and @peterthomassen for guidance. Thanks to @Spitfireap for work, and @peterthomassen for guidance.

View File

@@ -16,7 +16,7 @@ from .views import login, reset_cookie
import datetime import datetime
from .Common import get_redirect_url from .Common import get_redirect_url
from django.utils import timezone from django.utils import timezone
from django.http import JsonResponse
def recheck(request): def recheck(request):
"""Starts FIDO2 recheck""" """Starts FIDO2 recheck"""
@@ -49,13 +49,15 @@ def begin_registeration(request):
def complete_reg(request): def complete_reg(request):
"""Completes the registeration, called by API""" """Completes the registeration, called by API"""
try: try:
if not "fido_state" in request.session:
return JsonResponse({'status': 'ERR', "message": "FIDO Status can't be found, please try again"})
data = cbor.decode(request.body) data = cbor.decode(request.body)
client_data = CollectedClientData(data['clientDataJSON']) client_data = CollectedClientData(data['clientDataJSON'])
att_obj = AttestationObject((data['attestationObject'])) att_obj = AttestationObject((data['attestationObject']))
server = getServer() server = getServer()
auth_data = server.register_complete( auth_data = server.register_complete(
request.session['fido_state'], request.session.pop('fido_state'),
client_data, client_data,
att_obj att_obj
) )
@@ -79,7 +81,7 @@ def complete_reg(request):
client.captureException() client.captureException()
except: except:
pass pass
return HttpResponse(simplejson.dumps({'status': 'ERR', "message": "Error on server, please try again later"})) return JsonResponse({'status': 'ERR', "message": "Error on server, please try again later"})
def start(request): def start(request):

View File

@@ -4,7 +4,7 @@ from setuptools import find_packages, setup
setup( setup(
name='django-mfa2', name='django-mfa2',
version='2.6.0', version='2.6.1',
description='Allows user to add 2FA to their accounts', description='Allows user to add 2FA to their accounts',
long_description=open("README.md").read(), long_description=open("README.md").read(),
long_description_content_type="text/markdown", long_description_content_type="text/markdown",