fix(front-end): add more security fixes for formatted lists and notifier

- introduce html escape function
- escape message content in notifier plugin
- escape user name in ConversationListItem
- escape user name in the Event EditView contacts section
- display user summary as plain text in ActorCard

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
potsda.mn-Kollektiv
2023-12-07 14:28:59 +01:00
committed by Thomas Citharel
parent 5e3d8a861f
commit 1af8e37e9b
5 changed files with 26 additions and 4 deletions

View File

@@ -5,3 +5,13 @@ export const getValueFromMeta = (name: string): string | null => {
}
return null;
};
export function escapeHtml(html: string) {
const p = document.createElement("p");
p.appendChild(document.createTextNode(html.trim()));
const escapedContent = p.innerHTML;
p.remove();
return escapedContent;
}