I am working on an interactive Canvas tutorial. I want the students to be able to enter JavaScript into a contenteditable element, but I am afraid that it could introduce vulnerabilities.
I have thought about re-assigning dangerous objects or methods before evaluating their code, and then assigning it back afterwards.
How do I determine the dangerous objects?
Is this the right approach, or should I rather scan their input and only allow certain statements?