TACC / Core-CMS-Custom

Customized Core CMS code and builds
5 stars 0 forks source link

hotfix/WP-232-234-Include-text-areas-validation #203

Closed sophia-massie closed 1 year ago

sophia-massie commented 1 year ago

Overview

The purpose of this hotfix is to fix bug where the script checking for bad characters doesn't check the justification fields on extension and exception forms.

Your thoroughness of testing is really appreciated! I know it's tedious. Using Django or React utilities in place of this band-aid is the long term goal once the fire is put out.

Related

Changes

The checkForBlankInputs javascript was changed using whitelist methods to allow characters in input. At the same time, the script blacklists some explicit scripting character patterns. This is a front end change to prevent bad characters from making it to the server. The DB utils remove bad characters server side in apcd_database.py.

Testing

  1. Go to http://localhost:8000/register/request-to-submit/
  2. Try to input javascript.exe, anything in "quotes" or 'quotes" { hello.exe } thisshouldwork@test.com into the field into the explanation justification field
  3. On change. the field should be replaced with Try to input script script exe anything in quotes or quotes helloexe thisshouldworktestcom
  4. Go to http://localhost:8000/submissions/threshold-exception/
  5. Repeat steps 2 and 3
  6. Go to http://localhost:8000/submissions/other-exception/
  7. Repeat steps 2 and 3
  8. Go to https://apcd-qa.tacc.utexas.edu/submissions/extension-request/
  9. Repeat steps 2 and 3

UI

User input:

Screenshot 2023-08-22 at 6 07 51 PM

On change, text is changed to :

Screenshot 2023-08-22 at 6 08 53 PM