Neckr0ik Security Fixer
简介
Neckr0ik Security Fixer
原始描述
Auto-fix security vulnerabilities in OpenClaw skills. Works with neckr0ik-security-scanner to automatically remediate hardcoded secrets, shell injection risk...
通过你的 Agent 添加
安装目录:neckr0ik-security-fixer/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
技能正文
name: neckr0ik-security-fixer
version: 1.0.0
description: 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.
Security Fixer
Automatically fixes security vulnerabilities found by neckr0ik-security-scanner.
Quick Start
# Scan and fix in one command
neckr0ik-security-fixer fix /path/to/skill --auto
# Interactive fix (confirm each change)
neckr0ik-security-fixer fix /path/to/skill
# Generate .env.example only
neckr0ik-security-fixer env /path/to/skill
What This Fixes
Critical Issues (Auto-fixable)
Issue
Fix Applied
Hardcoded Secrets
Replaces with os.environ.get() + generates .env.example
Shell Injection
Converts to subprocess.run() with shell=False
eval/exec
Wraps with safe alternatives or flags for review
High Issues (Auto-fixable)
# Scan and fix in one command
neckr0ik-security-fixer fix /path/to/skill --auto
# Interactive fix (confirm each change)
neckr0ik-security-fixer fix /path/to/skill
# Generate .env.example only
neckr0ik-security-fixer env /path/to/skill
Critical Issues (Auto-fixable)
| Issue | Fix Applied |
|---|---|
| Hardcoded Secrets | Replaces with os.environ.get() + generates .env.example |
| Shell Injection | Converts to subprocess.run() with shell=False |
| eval/exec | Wraps with safe alternatives or flags for review |
| Issue | Fix Applied |
|---|---|
| Prompt Injection | Adds sanitization wrapper |
| Path Traversal | Adds pathlib validation |
How It Works
- Runs security scan on target skill
- For each vulnerability, generates fix
- Applies fix automatically (with
--auto) or prompts for confirmation
- Creates
.env.example with detected secret placeholders
- Updates
.gitignore to exclude .env
Example Fixes
Hardcoded API Key
--auto) or prompts for confirmation.env.example with detected secret placeholders.gitignore to exclude .envHardcoded API Key
Before:
api_key = "sk-abc123def456..."
After:
import os
api_key = os.environ.get("OPENAI_API_KEY")
if not api_key:
raise ValueError("OPENAI_API_KEY environment variable required")
Generated .env.example:
OPENAI_API_KEY=your-key-here
Shell Injection
Before:
os.system(f"convert {filename} output.png")
After:
import subprocess
result = subprocess.run(
["convert", filename, "output.png"],
capture_output=True,
check=True
)
Prompt Injection
Before:
prompt = f"User says: {user_input}"
After:
import re
def sanitize_for_prompt(text: str) -> str:
return re.sub(r'[<>\{\}\[\]\\]', '', text[:1000])
prompt = f"User says: {sanitize_for_prompt(user_input)}"
Commands
fix
neckr0ik-security-fixer fix <skill-path> [options]
Options:
--auto Apply all fixes without prompting
--dry-run Show what would be fixed without making changes
--backup Create .bak files before modifying
env
neckr0ik-security-fixer env <skill-path>
Generates:
- .env.example (template with placeholders)
- Updates .gitignore to exclude .env
report
neckr0ik-security-fixer report <skill-path> --format json
Outputs a detailed fix report with:
- Original vulnerable code
- Fixed code
- Files modified
- Manual review items
Safety Features
- Backup files created by default (can disable with
--no-backup)
- Dry-run mode shows changes without applying
- Manual review flagging for complex issues that need human judgment
- Git integration - shows diff before applying
See Also
neckr0ik-security-scanner - Scan for vulnerabilities first
references/fix-templates.md - Complete fix template library
scripts/fixer.py - Main fixer script
neckr0ik-security-fixer env <skill-path>
Generates:
- .env.example (template with placeholders)
- Updates .gitignore to exclude .env
neckr0ik-security-fixer report <skill-path> --format json
Outputs a detailed fix report with:
- Original vulnerable code
- Fixed code
- Files modified
- Manual review items
Safety Features
- Backup files created by default (can disable with
--no-backup)
- Dry-run mode shows changes without applying
- Manual review flagging for complex issues that need human judgment
- Git integration - shows diff before applying
See Also
neckr0ik-security-scanner - Scan for vulnerabilities first
references/fix-templates.md - Complete fix template library
scripts/fixer.py - Main fixer script
--no-backup)neckr0ik-security-scanner- Scan for vulnerabilities firstreferences/fix-templates.md- Complete fix template libraryscripts/fixer.py- Main fixer script
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。