Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:lock: Sanitize attribute view Template calculation output https://github.com/siyuan-note/siyuan/security/advisories/GHSA-rwh7-gm74-67h6

Daniel2852eae518a4
diff --git a/app/src/protyle/render/av/calc.ts b/app/src/protyle/render/av/calc.ts
index 92f7dc2027..bb99e99b4c 100644
--- a/app/src/protyle/render/av/calc.ts
+++ b/app/src/protyle/render/av/calc.ts
@@ -6,6 +6,7 @@ import {getFieldsByData} from "./view";
import {Constants} from "../../../constants";
import {Dialog} from "../../../dialog";
import {escapeAttr} from "../../../util/escape";
+import {getAVTemplateHTML} from "./attributeValue";
const calcItem = (options: {
menu: Menu,
@@ -582,7 +583,7 @@ export const getCalcValue = (column: IAVColumn) => {
value = `<span>${resultCalc.formattedContent}</span><small>${window.siyuan.languages.percentUnchecked}</small>`;
break;
case "Template":
- value = `<span>${resultCalc.formattedContent ?? resultCalc.content}</span><small>${window.siyuan.languages.calcResultTemplate}</small>`;
+ value = `<span>${getAVTemplateHTML(resultCalc.formattedContent ?? resultCalc.content)}</span><small>${window.siyuan.languages.calcResultTemplate}</small>`;
break;
}
return value;