JavaScript 安全审查

Identify and remediate JavaScript frontend security issues in React, Vue, and Angular projects.

839|261|Updated Apr 18, 2019
One-click install
npx skills add https://github.com/TencentBlueKing/bk-bcs --skill javascript-tencentblueking
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: JavaScript 安全审查
Source: https://github.com/TencentBlueKing/bk-bcs/tree/main/bcs-services/bcs-project-manager/.cursor/skills/js-security-check
Command: npx skills add https://github.com/TencentBlueKing/bk-bcs --skill javascript-tencentblueking

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

JavaScript 安全审查 通过检查常见的前端安全问题,帮助开发团队发现并修复 XSS、CSRF、原型污染等风险,提升应用的安全性。

Core Features & Use Cases

  • 基本规则:永不信任用户输入、默认安全、纵深防御,确保在各层对输入进行校验、转义与限制。
  • 适用场景:适用于 React、Vue、Angular 等前端框架的代码审查、CI 流程中的安全检查以及日常安全评估。
  • Use Case:在大型表单密集的前端应用中,帮助识别和修复危险模式,避免未转义的内容直接插入 DOM。

Quick Start

运行 js-security-check 对 src 目录进行安全审查并生成报告。

Frequently Asked Questions about JavaScript 安全审查

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find and fix XSS vulnerabilities in my React or Vue frontend code?

To find and fix XSS vulnerabilities in React or Vue, you need a security review that identifies dangerous DOM insertion patterns and enforces input sanitization. This process scans your codebase to detect unescaped user inputs and provides defensive remediation patterns.

What is prototype pollution in JavaScript and how can I prevent it during code review?

Prototype pollution in JavaScript occurs when user input modifies object prototypes, allowing attackers to manipulate application logic. Preventing it during code review involves enforcing defensive patterns that validate and restrict object property assignments before processing untrusted data.

Does this JavaScript security check work with Angular projects in a CI pipeline?

Yes, this JavaScript security check works with Angular projects in a CI pipeline. It is designed to enforce DOM safety, input sanitization, and defensive patterns across React, Vue, and Angular during development and continuous integration security assessments.

How do I scan a src directory for CSRF risks and generate a security report?

To scan a src directory for CSRF risks and generate a security report, run a targeted security check command against your source code. This evaluates your application for missing defensive patterns against CSRF and outputs a detailed remediation report.

What is the best way to ensure DOM safety in form-intensive web applications?

The best way to ensure DOM safety in form-intensive web applications is applying a default-secure, defense-in-depth approach. This requires validating and escaping all user inputs across application layers to prevent unescaped content from being directly inserted into the DOM.

Why should I never trust user input when building frontend JavaScript applications?

You should never trust user input in frontend JavaScript applications because unvalidated data introduces critical risks like XSS and CSRF. Enforcing input validation, escaping, and restriction at all layers ensures DOM safety and prevents malicious script execution.