Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed XSS vulnerability in week 3 #27

Merged
merged 1 commit into from
Apr 25, 2017
Merged

Fixed XSS vulnerability in week 3 #27

merged 1 commit into from
Apr 25, 2017

Conversation

felixschorer
Copy link
Contributor

@felixschorer felixschorer commented Apr 24, 2017

Fix for #23:
Added input validation to both google sheets projects in week 3 to prevent cross site scripting attacks.
In week3-apis-data/09_google_sheets/sketch.js:

  • Check if label is indeed a string with only alphanumerical characters and spaces.
  • Check if number is valid number with only digits, dots and commas.
  • Check if timestamp has the format MM/DD/YYYY hh:mm:ss.
    0/99/2017 8:61:93 would also pass the check despite not being a valid timestamp.

In week3-apis-data/10_google_sheets_madlibs/sketch.js:

  • Check if the replacement text only contains letter, digits and basic punctuation, as well as spaces.
    If a replacement text fails the test it will redraw a new one.

@shiffman
Copy link
Collaborator

Thank you so so so much for this!

@shiffman shiffman merged commit 1b3b0eb into Programming-from-A-to-Z:gh-pages Apr 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants