Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(desktop): validate quoted skill metadata

xd-boboc28414841a8e
diff --git a/apps/desktop/resources/system-skills/cindy-skill-creator/scripts/_frontmatter.py b/apps/desktop/resources/system-skills/cindy-skill-creator/scripts/_frontmatter.py
index 20034aed06..5086f6ee88 100644
--- a/apps/desktop/resources/system-skills/cindy-skill-creator/scripts/_frontmatter.py
+++ b/apps/desktop/resources/system-skills/cindy-skill-creator/scripts/_frontmatter.py
@@ -179,7 +179,18 @@ def _parse_scalar(raw):
if value.startswith("'"):
if len(value) < 2 or not value.endswith("'"):
raise FrontmatterError("Invalid single-quoted scalar")
- return value[1:-1].replace("''", "'")
+ inner = value[1:-1]
+ index = 0
+ while index < len(inner):
+ if inner[index] != "'":
+ index += 1
+ continue
+ if index + 1 >= len(inner) or inner[index + 1] != "'":
+ raise FrontmatterError(
+ "Single quotes inside a single-quoted scalar must be doubled"
+ )
+ index += 2
+ return inner.replace("''", "'")
lowered = value.lower()
if lowered in {"null", "~"} or value == "":