Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问clear审计通过

fix-code-vulnerability修复代码漏洞

Agent Skill

用于辅助安全审计、权限检查、凭据风险、认证流程和常见漏洞排查。它适合让 Agent 梳理敏感配置、检查依赖风险、分析鉴权逻辑或生成安全复核清单。使用时不能把工具输出直接当最终结论,涉及密钥、令牌、用户数据或生产系统时,应先确认最小权限、脱敏方式和操作边界。

总安装

1,038

周安装

42

GitHub Stars

93

下载量

326
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:fix-code-vulnerability(修复代码漏洞)
来源仓库:https://github.com/letta-ai/skills
仓库路径:skills/fix-code-vulnerability
安装命令:
npx skills add https://github.com/letta-ai/skills --skill fix-code-vulnerability
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/letta-ai/skills --skill fix-code-vulnerability

简介

fix-code-vulnerability 用于辅助安全审计和漏洞排查。

  • 适合梳理敏感配置、检查依赖风险或分析鉴权逻辑。
  • 通过 npx skills add 命令从指定仓库安装,需确认权限与维护状态。
  • 不能将工具输出直接当作最终结论,涉及密钥时应确认最小权限。
  • 建议结合原始 README 进一步核验具体用法和功能边界。

SKILL.md

Fix Code Vulnerability

Overview

This skill provides a systematic approach for identifying, analyzing, and fixing security vulnerabilities in codebases. It covers common vulnerability types (injection attacks, input validation issues, etc.) and provides verification strategies to ensure fixes are complete and correct.

Workflow

Phase 1: Initial Reconnaissance

Start by understanding the scope and nature of the vulnerability:

  1. Run existing tests first - Execute the test suite to identify any failing security-related tests. Failing tests often directly indicate what vulnerability needs to be fixed and what behavior is expected.
  2. Read failing tests immediately - When security tests fail, read them first before exploring the broader codebase. Tests reveal:

- The exact vulnerability type (CWE number, attack vector) - Expected defensive behavior - Specific inputs that should be blocked - The API or function under test

  1. Identify the vulnerability type - Classify the vulnerability:

- CWE-89: SQL Injection - CWE-78: OS Command Injection - CWE-79: Cross-Site Scripting (XSS) - CWE-93: CRLF Injection (HTTP Response Splitting) - CWE-22: Path Traversal - CWE-94: Code Injection - CWE-611: XML External Entity (XXE)

Phase 2: Code Analysis

Trace the vulnerable code path:

  1. Follow the data flow - Trace from user input to the vulnerable operation:

- Entry points (API endpoints, form handlers, file readers) - Data transformation functions - Output points (database queries, file operations, HTTP responses)

  1. Identify the fix location - Prefer fixing at centralized helper functions rather than multiple call sites:

- Look for utility functions that process the vulnerable data - Fixing a shared helper covers all callers automatically - Avoid scattered fixes that may miss edge cases

  1. Read code in larger chunks - When analyzing related functions, read them together rather than making many small reads. This provides better context for understanding the code flow.

Phase 3: Implementing the Fix

Apply the appropriate defensive measure:

  1. Input validation - For injection vulnerabilities:

- Validate against dangerous characters (e.g., \n, \r, \0 for CRLF) - Use allowlists when possible (define what IS allowed vs. what is NOT) - Raise clear error messages that identify the issue

  1. Output encoding - For XSS and similar:

- Encode output appropriate to the context (HTML, URL, JavaScript) - Use framework-provided encoding functions

  1. Parameterization - For SQL/command injection:

- Use parameterized queries or prepared statements - Avoid string concatenation with user input

  1. Error handling - Ensure the fix:

- Raises appropriate exceptions with descriptive messages - Does not leak sensitive information in error messages - Fails securely (deny by default)

Phase 4: Verification

Confirm the fix is complete:

  1. Run the full test suite - All tests should pass, including:

- The originally failing security tests - Existing functionality tests (ensure no regressions)

  1. Verify edge cases are covered - Check that the fix handles:

- All variations of the attack (e.g., all control characters, not just \n) - Both direct and indirect attack paths - All methods that could trigger the vulnerability

  1. Create a vulnerability report - Document:

- Vulnerability type and CWE identifier - Affected code locations - Fix description and rationale - Test coverage confirmation

Common Pitfalls

Avoid These Mistakes

  1. Incomplete character coverage - When blocking dangerous characters, ensure all variants are covered (e.g., both \r and \n for CRLF, not just one).
  2. Fixing at wrong level - Don't patch individual call sites when a centralized fix is available. Find the common helper function.
  3. Missing indirect paths - A function may be called through multiple code paths. Verify the fix covers all entry points.
  4. Skipping test verification - Always run tests after applying fixes. Visual inspection is insufficient.
  5. Overly broad fixes - Don't break legitimate functionality. Understand what valid inputs look like before blocking patterns.

Attack Scenarios to Consider

When fixing vulnerabilities, understand the attack:

  • CRLF Injection (CWE-93): Attacker injects \r\n to split HTTP headers, enabling response splitting attacks
  • SQL Injection (CWE-89): Attacker escapes string context to execute arbitrary SQL
  • Command Injection (CWE-78): Attacker uses shell metacharacters to execute system commands
  • Path Traversal (CWE-22): Attacker uses ../ sequences to access files outside intended directory

Process Efficiency Tips

  1. Start with tests - Running tests first immediately reveals which security checks are failing and what behavior is expected.
  2. Read tests before code - Security tests describe the vulnerability and expected fix more clearly than searching the codebase.
  3. Fix centralized functions - Identify and fix shared helper functions to cover all code paths with minimal changes.
  4. Verify once, comprehensively - Run the full test suite rather than individual tests to catch any regressions.
  5. Document the vulnerability - Create a report that explains the vulnerability type, fix applied, and verification performed.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

27.52%
按下载量换算90

Gemini CLI

26.62%
按下载量换算87

Codex

19.43%
按下载量换算63

Antigravity

12.36%
按下载量换算40

OpenCode

7.9%
按下载量换算26

windsurf

4.11%
按下载量换算13

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/letta-ai/skills --skill fix-code-vulnerability;npx skills add letta-ai/skills --skill "fix-code-vulnerability" 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills