template-injection

仓库创建 2026年7月1日最近提交 23 天前SkillHot 收录 22 天前
▸ 精选理由

在生成视图与模板代码时可显著降低远程代码执行隐患。

这个 Skill 做什么

防止服务器端模板注入(SSTI),通过绑定变量与静态模板源避免执行风险。

主要防止 SSTI(服务器端模板注入),就是用户输入被当成模板源码去执行的风险。凡是会把用户内容送进 template compiler、双重渲染流程或动态拼模板的场景都要用。关键做法是把用户数据作为绑定变量/上下文传入、只加载静态受信的模板源,绝不拼接成模板源码或松开沙箱。

▸ 展开 SKILL.md 英文原文

Prevent server-side template injection — user input reaching a template compiler, double-render pipelines, sandbox escapes, and template-driven resource exhaustion

开发编程模板注入SSTI输入绑定通用
2
Stars
0
Forks
40
仓库内 Skill
+0
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/ShieldNet-360/secure-vibe/main/skills/template-injection/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/ShieldNet-360/secure-vibe/main/skills/template-injection/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# Template Injection (SSTI)

## Rules (for AI agents)

### ALWAYS
- Pass user data to a template only as **bound values / context variables**, never
  concatenated or interpolated into the template **source** string. `render(tmpl, {name})`
  is safe; `render("Hello " + name)` is SSTI.
- Keep the set of template sources **static and trusted** — load them from files or
  constants the user cannot influence. A template whose text comes from the DB, an API
  response, or a request field is attacker-controlled *code*, not data.
- Treat any **second render pass** as code execution. If the output of one render is
  parsed and executed as a template again (double render), a user value that survived
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有