返回顶部
n

neckr0ik-security-fixer安全漏洞修复

Auto-fix security vulnerabilities in OpenClaw skills. Works with neckr0ik-security-scanner to automatically remediate hardcoded secrets, shell injection risks, prompt injection, and path traversal issues. Generates secure code replacements and environment variable templates.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
228
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

neckr0ik-security-fixer

安全修复器

自动修复由 neckr0ik-security-scanner 发现的安全漏洞。

快速开始

bash

一键扫描并修复


neckr0ik-security-fixer fix /path/to/skill --auto

交互式修复(逐一确认更改)

neckr0ik-security-fixer fix /path/to/skill

仅生成 .env.example 文件

neckr0ik-security-fixer env /path/to/skill

修复内容

严重问题(可自动修复)

问题修复方式
硬编码密钥替换为 os.environ.get() + 生成 .env.example
Shell 注入
转换为 subprocess.run() 并设置 shell=False | | eval/exec | 使用安全替代方案包装或标记待审查 |

高危问题(可自动修复)

问题修复方式
提示注入添加消毒包装器
路径遍历
添加 pathlib 验证 |

工作原理

  1. 1. 对目标技能运行安全扫描
  2. 针对每个漏洞生成修复方案
  3. 自动应用修复(使用 --auto)或提示确认
  4. 使用检测到的密钥占位符创建 .env.example
  5. 更新 .gitignore 以排除 .env 文件

修复示例

硬编码 API 密钥

修复前:
python
api_key = sk-abc123def456...

修复后:
python
import os
apikey = os.environ.get(OPENAIAPI_KEY)
if not api_key:
raise ValueError(OPENAIAPIKEY environment variable required)

生成的 .env.example:

OPENAIAPIKEY=your-key-here

Shell 注入

修复前:
python
os.system(fconvert {filename} output.png)

修复后:
python
import subprocess
result = subprocess.run(
[convert, filename, output.png],
capture_output=True,
check=True
)

提示注入

修复前:
python
prompt = fUser says: {user_input}

修复后:
python
import re
def sanitizeforprompt(text: str) -> str:
return re.sub(r[<>\{\}\[\]\\], , text[:1000])

prompt = fUser says: {sanitizeforprompt(user_input)}

命令

fix

bash
neckr0ik-security-fixer fix [options]

选项:
--auto 自动应用所有修复,无需确认
--dry-run 显示将要修复的内容,但不实际修改
--backup 在修改前创建 .bak 备份文件

env

bash
neckr0ik-security-fixer env

生成:
- .env.example(包含占位符的模板)
- 更新 .gitignore 以排除 .env 文件

report

bash
neckr0ik-security-fixer report --format json

输出详细的修复报告,包含:
- 原始漏洞代码
- 修复后的代码
- 修改的文件
- 需要人工审查的项目

安全特性

  • - 备份文件默认创建(可使用 --no-backup 禁用)
  • 预览模式显示更改但不实际应用
  • 人工审查标记针对需要人工判断的复杂问题
  • Git 集成在应用前显示差异对比

相关资源

  • - neckr0ik-security-scanner - 首先扫描漏洞
  • references/fix-templates.md - 完整的修复模板库
  • scripts/fixer.py - 主修复脚本

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 neckr0ik-security-fixer-1776198823 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 neckr0ik-security-fixer-1776198823 技能

通过命令行安装

skillhub install neckr0ik-security-fixer-1776198823

下载

⬇ 下载 neckr0ik-security-fixer v1.0.0(免费)

文件大小: 9.87 KB | 发布时间: 2026-4-15 13:27

v1.0.0 最新 2026-4-15 13:27
Initial release of neckr0ik-security-fixer.

- Automatically remediates hardcoded secrets, shell injection, prompt injection, and path traversal vulnerabilities in OpenClaw skills.
- Integrates with neckr0ik-security-scanner for seamless vulnerability detection and fixing.
- Generates secure code replacements and .env.example templates, updating .gitignore as needed.
- Supports auto-fix, interactive fixes, dry-run mode, and backup file creation.
- Outputs detailed reports and flags issues needing manual review.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部