From b986a8637b57c5cd8b2c5722f29f9893aef3f04c Mon Sep 17 00:00:00 2001 From: Emily Sarneso Date: Thu, 19 May 2022 11:14:10 -0400 Subject: [PATCH] Version 1.50.0: Contact Management redesign. Fix CodeQL alerts 20220527 #96-102, using is_safe_url even when superfluous. Don't trust HTTP_REFERER header. Upgrade dependencies Redirect to the appropriate dashboard if bad link. Add new workflow for MFA Requests. Fix sort on vincecomm dashboard and case views by last post date, highlight cases with new posts. --- CHANGELOG.md | 22 + bakery/static_views.py | 8 +- bigvince/settings_.py | 2 +- cogauth/forms.py | 15 +- cogauth/templates/cogauth/loginhelp.html | 11 +- cogauth/templates/cogauth/profile.html | 2 +- cogauth/templates/cogauth/resetmfa.html | 22 + cogauth/templates/cogauth/signup.html | 6 + cogauth/urls.py | 3 +- cogauth/utils.py | 18 +- cogauth/views.py | 72 +- kbworker/views.py | 161 ++- vince/admin.py | 4 +- vince/fixtures/EmailTemplate.json | 2 +- vince/forms.py | 51 +- vince/lib.py | 81 +- vince/migrations/0002_auto_20220719_1530.py | 23 + vince/models.py | 12 +- vince/static/vince/css/style.css | 17 +- vince/static/vince/js/case.js | 15 + vince/static/vince/js/contact.js | 33 + vince/static/vince/js/contactverify.js | 37 +- vince/static/vince/js/scontact.js | 141 +- vince/static/vince/js/signup.js | 11 + vince/static/vince/js/tickets.js | 2 +- vince/static/vince/js/vinny_dashboard.js | 18 +- vince/templates/vince/add_email_contact.html | 49 + vince/templates/vince/case.html | 2 + vince/templates/vince/case_summary.html | 1 + vince/templates/vince/confirm_rm_email.html | 25 + vince/templates/vince/contact.html | 241 +++- vince/templates/vince/contact_report.html | 7 + vince/templates/vince/contactsresults.html | 2 +- vince/templates/vince/create_case.html | 4 +- vince/templates/vince/edit_case.html | 2 +- vince/templates/vince/editcontact.html | 79 +- vince/templates/vince/editgroup.html | 94 +- vince/templates/vince/group.html | 169 +-- .../vince/include/alt_contact_activity.html | 81 ++ vince/templates/vince/initcontactverify.html | 16 +- vince/templates/vince/newcontact.html | 458 +------ vince/templates/vince/searchcontacts.html | 5 +- vince/templates/vince/share_vulnote.html | 12 +- vince/templates/vince/vincecomm_user.html | 8 +- vince/templatetags/contact_tags.py | 29 + vince/urls.py | 8 +- vince/views.py | 1134 +++++++++++------ vincepub/models.py | 2 +- vinceworker/views.py | 49 +- vinny/admin.py | 9 +- vinny/lib.py | 26 +- vinny/migrations/0002_auto_20220719_1530.py | 18 + vinny/models.py | 10 +- vinny/static/vinny/js/gadmin.js | 12 + vinny/static/vinny/js/vinny.js | 2 +- vinny/static/vinny/js/vinny_dashboard.js | 2 +- vinny/templates/vinny/admin.html | 49 +- vinny/templates/vinny/admin_users.html | 4 + .../templates/vinny/confirm_email_change.html | 28 + vinny/templates/vinny/dashboard.html | 27 +- vinny/templates/vinny/editcontact.html | 6 + vinny/templates/vinny/include/cases.html | 19 +- vinny/templates/vinny/include/dash_case.html | 7 +- vinny/templates/vinny/post.html | 17 +- vinny/templates/vinny/searchresults.html | 5 +- vinny/templatetags/user_tags.py | 18 + vinny/urls.py | 1 + vinny/views.py | 183 ++- 68 files changed, 2376 insertions(+), 1333 deletions(-) create mode 100644 cogauth/templates/cogauth/resetmfa.html create mode 100644 vince/migrations/0002_auto_20220719_1530.py create mode 100644 vince/templates/vince/add_email_contact.html create mode 100644 vince/templates/vince/confirm_rm_email.html create mode 100644 vince/templates/vince/include/alt_contact_activity.html create mode 100644 vinny/migrations/0002_auto_20220719_1530.py create mode 100644 vinny/templates/vinny/confirm_email_change.html diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cc2a1c..33241ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # VINCE Changelog +# Version 1.50.0: 2022-07-19 +============================ + +New MFA reset workflow + +Allow comments when re-assigning tickets + +Sorting improvements on VINCEComm Dashboard + +Add Vul Note download button in VINCETrack + +Bug Fixes + +# Version 1.49.0: 2022-07-19 +=========================== + +Contact Management Updates + +Dependency Upgrades + +Bug Fixes + # Version 1.48.0: 2022-05-13 ============================= diff --git a/bakery/static_views.py b/bakery/static_views.py index 77fd1b1..8b8cf20 100644 --- a/bakery/static_views.py +++ b/bakery/static_views.py @@ -14,7 +14,8 @@ from django.http import HttpResponseNotModified from django.template import Template, Context, TemplateDoesNotExist from django.utils.http import http_date, parse_http_date - +from django.conf import settings +from django.utils.http import is_same_domain, is_safe_url def serve(request, path, document_root=None, show_indexes=False, default=''): """ @@ -52,7 +53,10 @@ def serve(request, path, document_root=None, show_indexes=False, default=''): continue newpath = os.path.join(newpath, part).replace('\\', '/') if newpath and path != newpath: - return HttpResponseRedirect(newpath) + if is_safe_url(newpath,set(settings.ALLOWED_HOSTS),True): + return HttpResponseRedirect(newpath) + else: + raise Http404("Invalid or Incorrect path found") fullpath = os.path.join(document_root, newpath) if os.path.isdir(fullpath) and default: defaultpath = os.path.join(fullpath, default) diff --git a/bigvince/settings_.py b/bigvince/settings_.py index b8fcf83..eef0e43 100644 --- a/bigvince/settings_.py +++ b/bigvince/settings_.py @@ -56,7 +56,7 @@ ROOT_DIR = environ.Path(__file__) - 3 # any change that requires database migrations is a minor release -VERSION = "1.48.0" +VERSION = "1.50.0" # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/ diff --git a/cogauth/forms.py b/cogauth/forms.py index 46c15e0..ce8957b 100644 --- a/cogauth/forms.py +++ b/cogauth/forms.py @@ -83,6 +83,13 @@ class Meta: 'countrycode': CountrySelectWidget()} +class COGResetMFA(forms.Form): + + reason = forms.CharField( + widget=forms.Textarea(), + label=_('Reason for MFA reset')) + + class COGInitialPWResetForm(forms.Form): username = forms.CharField(max_length=200, required=True, label=_("Email")) @@ -260,9 +267,11 @@ class SignUpForm(UserCreationForm): required=False) email = forms.CharField( max_length=254, + widget=forms.TextInput(attrs={'autocomplete':'username'}), required=True, - help_text=_('This will be your login username. Please note that this field is CASE SENSITIVE.'), + help_text=_('This will be your personal login username. This field is CASE SENSITIVE.
PLEASE NOTE: Each VINCE user account is intended to be tied to a specific individual. If you would like to use an alias (for example, psirt@example.com) to receive group notifications, please create your account here first, and once your individual account has been approved, you will have the opportunity to create a group, join an existing group, and otherwise manage the email addresses associated with your organization.'), label="Email address") + title = forms.CharField( max_length=200, required=False, @@ -279,7 +288,7 @@ class SignUpForm(UserCreationForm): password1 = forms.CharField( max_length=50, required=True, - widget=forms.PasswordInput, + widget=forms.PasswordInput(attrs={'autocomplete':"new-password"}), label="New Password", help_text=_('Password Requirements: