Skip to content

Commit ab0c95d

Browse files
author
Philip Guo
committed
try to prevent HTML/JS injection attacks
1 parent 173ee30 commit ab0c95d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎v3/js/pytutor.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ ExecutionVisualizer.prototype.destroyAllAnnotationBubbles = function() {
455455
ExecutionVisualizer.prototype.initStepAnnotation = function() {
456456
var curEntry = this.curTrace[this.curInstr];
457457
if (curEntry.stepAnnotation) {
458-
this.domRoot.find("#stepAnnotationViewer").html(curEntry.stepAnnotation);
458+
this.domRoot.find("#stepAnnotationViewer").html(htmlspecialchars(curEntry.stepAnnotation)); // help prevent HTML/JS injection attacks
459459
this.domRoot.find("#stepAnnotationEditor").val(curEntry.stepAnnotation);
460460
}
461461
else {
@@ -2673,7 +2673,7 @@ AnnotationBubble.prototype.showViewer = function() {
26732673
// destroy then create a new tip:
26742674
this.destroyQTip();
26752675
$(this.hashID).qtip($.extend({}, qtipShared, {
2676-
content: this.text,
2676+
content: htmlspecialchars(this.text), // help prevent HTML/JS injection attacks
26772677
id: this.domID,
26782678
position: {
26792679
my: this.my,

0 commit comments

Comments
 (0)