用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/ersinkoc/security-check --skill sc-xss命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | sc-xss |
| description | Cross-Site Scripting detection for Reflected, Stored, and DOM-based XSS across all frameworks |
| license | MIT |
| metadata | {"author":"ersinkoc","category":"security","version":"1.0.0"} |
Detects Cross-Site Scripting vulnerabilities across three categories: Reflected XSS (input reflected in response), Stored XSS (input persisted and rendered to other users), and DOM-based XSS (client-side JavaScript manipulation). Covers all major frontend frameworks and template engines, identifying cases where auto-escaping is bypassed.
Called by sc-orchestrator during Phase 2. Runs against all web applications and APIs returning HTML.
**/*.html, **/*.htm, **/*.ejs, **/*.hbs, **/*.pug, **/*.jade,
**/*.tsx, **/*.jsx, **/*.vue, **/*.svelte, **/*.php, **/*.blade.php,
**/*.erb, **/*.haml, **/*.jinja2, **/*.twig, **/*.cshtml, **/*.razor,
**/*.thymeleaf, **/*.ftl, **/templates/*, **/views/*,
**/*.ts, **/*.js (for DOM-based XSS)
# DOM-based XSS sinks
"innerHTML", "outerHTML", "document.write(", "document.writeln(",
"insertAdjacentHTML", ".html(", "$.html(",
"eval(", "setTimeout(.*,.*string", "setInterval(.*,.*string",
"location.href =", "location.assign(", "location.replace(",
"window.open(", "document.cookie"
# Framework-specific unsafe rendering
"dangerouslySetInnerHTML" # React
"v-html" # Vue
"[innerHTML]", "bypassSecurityTrust" # Angular
"{@html" # Svelte
"{!! !!}" # Laravel Blade (unescaped)
"| safe", "{% autoescape off %}", "mark_safe" # Django/Jinja2
"<%= %>" # ERB (unescaped)
"Html.Raw(" # ASP.NET Razor
"th:utext" # Thymeleaf (unescaped)
# Server-side reflected output
"res.send(", "res.write(", "response.write("
"echo ", "print ", "Response.Write("
Sources (user input reaching client):
document.location, document.URL, document.referrer (DOM sources)window.name, postMessage datalocation.hash)Sinks (unsafe rendering):
innerHTML, outerHTML, document.write()dangerouslySetInnerHTML (React)v-html (Vue), [innerHTML] (Angular)eval(), setTimeout(string), Function()<, >, &, ")dangerouslySetInnerHTML is unsafe.{{ }} auto-escapes. v-html is unsafe.bypassSecurityTrustHtml() is unsafe.{{ }} auto-escapes. {{ var|safe }}, {% autoescape off %}, mark_safe() are unsafe.{{ }} auto-escapes. {!! !!} is unsafe.{{ var|safe }} is unsafe.text/template does NOT auto-escape.th:text escapes. th:utext is unsafe.@Html.Encode() escapes. @Html.Raw() is unsafe.// VULNERABLE: Express reflecting input without encoding
app.get('/search', (req, res) => {
res.send(`<h1>Results for: ${req.query.q}</h1>`);
});
// SAFE: Using a template engine with auto-escaping
app.get('/search', (req, res) => {
res.render('search', { query: req.query.q }); // Template auto-escapes
});
// VULNERABLE: Using innerHTML with URL parameter
const params = new URLSearchParams(window.location.search);
document.getElementById('output').innerHTML = params.get('name');
// SAFE: Using textContent instead
document.getElementById('output').textContent = params.get('name');
# VULNERABLE: Rendering user-supplied HTML from database
@app.route('/profile/<user_id>')
def profile(user_id):
user = User.query.get(user_id)
return render_template('profile.html', bio=Markup(user.bio)) # mark_safe!
# SAFE: Let template auto-escape
@app.route('/profile/<user_id>')
def profile(user_id):
user = User.query.get(user_id)
return render_template('profile.html', bio=user.bio) # Auto-escaped
<img src=x onerror=alert(1)> as the {parameter} would execute JavaScript in the victim's browser.{variable} in JSX is auto-escaped, NOT vulnerable{{ variable }} is auto-escaped{{ }} and [property] are auto-sanitized