Improve web-page templating sanitization. #188
Labels
No labels
Bug
Cleanup/Refactor
Core Feature
Documentation
Feature
Performance Improvement
Security Improvement
UX/Accessibility
Unreproducable Bug
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
#164 Tweaks and Fixes
rainbownapkin/canopy
Reference: rainbownapkin/canopy#188
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Current EJS templates rely on input sanitization keep them safe. While we do trust the server to sanitize data before ingesting it, especially in cases in-which the data is saved to the DB, it would be safer to ensure we safely inject the data into the template no matter what.
We should replace uses of the
<%-with the<%=tag where possible, un-escaping HTML entities before-hand to ensure sanitized data displays properly, as<%=expects unsafe data usingvalidator.unescape(). This falls in-line with our method of injecting data on the client-side using JS, in which data is un-escaped withutils.ux.unescape()and injected safely using thenode.innerTextproperty.Improved sanitization for server-side templating:
08fe051269Improve web-page templating sanatization.to Improve web-page templating sanitization.