Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.
Go dockerfossgomarkdownmemomicroblognote-takingnotesopen-sourceown-your-datareactself-hostedsqlitetimeline
fix: code blocks of unknown languages cause HTML injection (#3711)
andrigameritad264f459797b
diff --git a/web/src/components/MemoContent/CodeBlock.tsx b/web/src/components/MemoContent/CodeBlock.tsxindex e96838eb8..d9177a5d2 100644--- a/web/src/components/MemoContent/CodeBlock.tsx+++ b/web/src/components/MemoContent/CodeBlock.tsx@@ -42,7 +42,10 @@ const CodeBlock: React.FC<Props> = ({ language, content }: Props) => {// Skip error and use default highlighted code.}- return content;+ // escape any HTML entities when rendering original content+ return Object.assign(document.createElement("span"), {+ textContent: content,+ }).innerHTML;}, [formatedLanguage, content]);const handleCopyButtonClick = useCallback(() => {