fix(安全): 修复HTML导出中的XSS漏洞并清理调试日志
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled

refactor(日志): 替换console.log为tracing日志系统
style(代码): 移除未使用的代码和依赖项

feat(测试): 添加端到端测试文档和CI工作流
docs(变更日志): 更新CHANGELOG.md记录0.1.0版本变更

perf(构建): 更新依赖版本并优化CI流程
This commit is contained in:
iven
2026-03-26 19:49:03 +08:00
parent b8d565a9eb
commit 978dc5cdd8
79 changed files with 3953 additions and 5724 deletions

View File

@@ -18,3 +18,4 @@ tracing = { workspace = true }
async-trait = { workspace = true }
regex = { workspace = true }
uuid = { workspace = true }
shlex = { workspace = true }

View File

@@ -360,8 +360,9 @@ mod tests {
#[test]
fn test_extract_types() {
let registry: &'static SkillRegistry = Box::leak(Box::new(SkillRegistry::new()));
let composer = AutoComposer {
registry: unsafe { &*(&SkillRegistry::new() as *const _) },
registry,
};
let schema = serde_json::json!({

View File

@@ -118,7 +118,12 @@ impl Skill for ShellSkill {
let mut cmd = self.command.clone();
if let Value::String(s) = input {
cmd = cmd.replace("{{input}}", &s);
// Shell-quote the input to prevent command injection
let quoted = shlex::try_quote(&s)
.map_err(|_| zclaw_types::ZclawError::ToolError(
"Input contains null bytes and cannot be safely quoted".to_string()
))?;
cmd = cmd.replace("{{input}}", &quoted);
}
#[cfg(target_os = "windows")]