
Security Audit Report【免費(fèi)下載鏈接】agent-skillsProduction-grade engineering skills for AI coding agents.項(xiàng)目地址: https://gitcode.com/GitHub_Trending/agentskill/agent-skillsSummaryCritical: [count]High: [count]Medium: [count]Low: [count]Findings[CRITICAL] [Finding title]Location:[file:line]Description:[What the vulnerability is]Impact:[What an attacker could do]Proof of concept:[How to exploit it]Recommendation:[Specific fix with code example][HIGH] [Finding title]...Positive Observations[Security practices done well]Recommendations[Proactive improvements to consider]模板中 Positive Observations 一節(jié)對應(yīng)規(guī)則 4好的安全實(shí)踐要被點(diǎn)名表揚(yáng)。Summary 中的計數(shù)則是 /ship 合并階段的聚合輸入——主 Agent 按 Critical/High 數(shù)量把發(fā)現(xiàn)提升為發(fā)布阻塞項(xiàng)。 ## 七、檢查項(xiàng)背后的實(shí)現(xiàn)證據(jù) 人格文件本身只定義“審什么、怎么報”每個檢查項(xiàng)在倉庫中都有可對照的落地實(shí)現(xiàn)審計者可以按圖索驥 **注入與參數(shù)化查詢。** [skills/security-and-hardening/SKILL.md](https://link.gitcode.com/i/cdcf28f25a4ae83830492228af107cb2) 給出了壞/好對照 typescript // BAD: SQL injection via string concatenation const query SELECT * FROM users WHERE id ${userId}; // GOOD: Parameterized query const user await db.query(SELECT * FROM users WHERE id $1, [userId]); **XSS 與輸出編碼。** 該技能同樣給出對照element.innerHTML userInput 為反例React 默認(rèn)自動轉(zhuǎn)義或必須渲染 HTML 時先用 DOMPurify.sanitize()。 **SSRF對應(yīng)范圍 5 的最后一問。** 技能中給出了完整的白名單 私有 IP 阻斷實(shí)現(xiàn)并明確指出 fetch 在檢查后會再次解析 DNS存在 TOCTOU 缺口 typescript // GOOD: allowlist scheme host, reject if ANY resolved IP is private, forbid redirects const ALLOWED_HOSTS new Set([hooks.example.com]); async function assertSafeUrl(raw: string): PromiseURL { const url new URL(raw); if (url.protocol ! https:) throw new Error(https only); if (!ALLOWED_HOSTS.has(url.hostname)) throw new Error(host not allowed); const addrs await lookup(url.hostname, { all: true }); if (addrs.some((a) ipaddr.parse(a.address).range() ! unicast)) { throw new Error(private/reserved IP); } return url; } await fetch(await assertSafeUrl(req.body.webhookUrl), { redirect: error }); range() ! unicast 一條檢查覆蓋回環(huán)、鏈路本地169.254.169.254 云元數(shù)據(jù)SSRF 首要目標(biāo)、私有與 IPv6 ULA 地址段。對高風(fēng)險面技能進(jìn)一步要求“一次解析、連接固定 IP”或前置過濾代理。 **通用錯誤信息對應(yīng)范圍 4。** [references/security-checklist.md](https://link.gitcode.com/i/0a1274043b8d6b4a1361dfa1f47a53c2) 的反例很直接生產(chǎn)環(huán)境返回 { error: err.message, stack: err.stack, query: err.sql } 會同時暴露內(nèi)部邏輯與數(shù)據(jù)庫細(xì)節(jié)正確做法是返回 INTERNAL_ERROR 這類通用代碼。 **供應(yīng)鏈風(fēng)險對應(yīng)規(guī)則 6 的 typosquats、postinstall 腳本。** 倉庫對依賴審計的處理相當(dāng)細(xì)[skills/security-and-hardening/SKILL.md](https://link.gitcode.com/i/cdcf28f25a4ae83830492228af107cb2) 提供了按嚴(yán)重度 × 可達(dá)性 × 是否有修復(fù)版本的審計結(jié)果分診決策樹以及“先定位安裝邊界 → 用原生 audit 命令 → 阻斷未審查的安裝腳本”的供應(yīng)鏈衛(wèi)生流程[references/security-checklist.md](https://link.gitcode.com/i/0a1274043b8d6b4a1361dfa1f47a53c2) 則按包管理器npm/pnpm/Yarn 各版本給出凍結(jié)安裝與審計命令對照表。security-auditor 在審依賴時可直接引用這些標(biāo)準(zhǔn)。 **LLM 特性的不可信輸出對應(yīng)范圍 6 第一問。** 技能中的反例恰好覆蓋了人格所問的 eval/SQL/innerHTML 三類 sink typescript // BAD: trusting model output as a command or as markup const sql await llm.generate(Write SQL for: ${userQuestion}); await db.query(sql); // arbitrary query execution container.innerHTML await llm.reply(userMessage); // stored XSS, via the model // GOOD: model output is data — parse defensively, then validate, then encode let intent; try { intent CommandSchema.parse(JSON.parse(await llm.replyJson(userMessage))); } catch { throw new ValidationError(unexpected model output); } await runAllowlistedAction(intent.action, intent.params); container.textContent await llm.reply(userMessage);【免費(fèi)下載鏈接】agent-skillsProduction-grade engineering skills for AI coding agents.項(xiàng)目地址: https://gitcode.com/GitHub_Trending/agentskill/agent-skills創(chuàng)作聲明:本文部分內(nèi)容由AI輔助生成(AIGC),僅供參考