This repository has been archived by the owner on Aug 26, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug 1272791 - Encode attachment data for JS
Data about attachments are assigned to a JavaScript variable so that they are available to CKEditor. The JSON encoder does not escape characters for this context, allowing user-entered data to be injected into the page in an unsafe way, allowing XSS attacks. This code switches to explicit escaping of strings using escapejs, removing the XSS vector. r=jgmize
- Loading branch information
Showing
5 changed files
with
15 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
from django_jinja import library | ||
|
||
from ..utils import allow_add_attachment_by, attachments_payload | ||
from ..utils import allow_add_attachment_by | ||
|
||
|
||
library.global_function(allow_add_attachment_by) | ||
library.global_function(attachments_payload) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters