Update team page JavaScript to prevent XSS #10097
Labels
Good First Issue
Easy issue. Good for newcomers. [managed]
Lead: @jimchamp
Issues overseen by Jim (Front-end Lead, BookNotes) [managed]
Module: JavaScript
Issues related to the JavaScript functionality. [managed]
Priority: 2
Important, as time permits. [managed]
Theme: Security
Type: Bug
Something isn't working. [managed]
Problem
The content of our team page is largely generated with JavaScript. When new elements are constructed for this page, text content is often added by setting the
innerHTML
property. This way of creating elements could leave us vulnerable to cross-site scripting attacks (more information here).Reproducing the bug
Context
Breakdown
Since none of the text content used to generate the team member cards contains markup, it may be easiest to use
textContent
instead ofinnerHTML
when creating the cards.Requirements Checklist
team.js
, replace all instances ofinnerHTML
withtextContent
Related files
team.js
Stakeholders
Instructions for Contributors
The text was updated successfully, but these errors were encountered: