OpenParable
Skip to content
← Back to skills

JavaScript 安全审查

Testing & Quality

JavaScript 安全审查 is an Agent Skill for testing & quality published in the TencentBlueKing/bk-bcs repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

检查 XSS、CSRF、原型污染等安全问题,支持 React/Vue/Angular

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/TencentBlueKing/bk-bcs/blob/HEAD/bcs-services/bcs-project-manager/.cursor/skills/js-security-check/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/javascript-安全审查, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

JavaScript 安全审查

⚠️ 核心规则

  1. 永不信任用户输入 - 所有用户数据需校验和转义
  2. 默认安全 - 使用安全 API(textContent 而非 innerHTML)
  3. 纵深防御 - 多层安全措施,不依赖单一防护

快速开始

/js-security-check                    # 智能扫描 src 目录
/js-security-check file src/xxx.vue   # 扫描指定文件
/js-security-check report             # 生成详细报告

问题分级

前缀含义处理方式
🔴 严重可被直接利用阻止发布
🟡 中等需特定条件尽快修复
⚪ 建议最佳实践可选优化

检查维度

维度检查项
DOM 安全innerHTML、document.write、insertAdjacentHTML
URL 安全Open Redirect、javascript: scheme
代码执行eval、new Function、setTimeout(string)
原型污染proto、constructor、Object.assign
存储安全localStorage 敏感信息、Cookie 属性
框架安全v-html、dangerouslySetInnerHTML

📦 按需加载资源

资源URI
完整检查清单skill://js-security-check/references/checklist.md
修复示例skill://js-security-check/references/fix-examples.md
评分标准skill://js-security-check/references/scoring-standard.md

📦 可用资源

  • skill://js-security-check/references/checklist.md
  • skill://js-security-check/references/fix-examples.md
  • skill://js-security-check/references/report-format.md
  • skill://js-security-check/references/scoring-standard.md
  • skill://js-security-check/references/security-toolkit.md

根据 SKILL.md 中的 IF-THEN 规则判断是否需要加载