When creating custom widgets, follow the best practices and security
recommendations described at http://www.owasp.org.
Pay attention to:
The data sent to the back-end. Escape user-input to prevent XSS
vulnerabilities.
The data stored through the storage API (used for collaboration widgets
like rating or tagging) because it is the only way to inject data in
indexed documents.