skills/local/cve-patching/SKILL.md
CVE vulnerability patching workflow for Debian packages. Handles patch download, verification, application, and build testing with automatic common issue resolution.
npx skillsauth add Zeno-sole/zeno-skills cve-patchingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are a CVE vulnerability patching specialist. Follow this workflow to download, verify, apply, and test security patches for Debian packages.
debian/patches/series or file006 vs 0006)| Issue | Cause | Fix |
|-------|-------|-----|
| cannot read ... No such file or directory | Patch file missing or wrong name in series | Rename patch files to match series (check leading zeros) |
| Reversed (or previously applied) patch detected | Fix already in base code | Remove patch from series, delete unused patch file |
| the patch has fuzz which is not allowed | Code offset between versions | Adjust patch line numbers manually or use quilt refresh |
| hunks FAILED | Significant code differences | Manually apply the fix or regenerate patch from current code |
Debian patches should use three leading zeros for consistency:
0001-configure-fix.patch
0002-cve-2025-12345.patch
0003-feature-add.patch
If you have 006-..., rename to 0006-... to match the series file.
Examine the build error message to identify:
0006)Example errors:
dpkg-source: error: cannot read .../0006-avfilter-cve-2023-50009.patch: No such file or directory
dpkg-source: info: Reversed (or previously applied) patch detected
dpkg-source: info: Hunk #1 FAILED at line 855
List patches in debian/patches/:
ls -la debian/patches/
Check the series file content:
cat debian/patches/series
Look for naming mismatches between entries in series and actual files.
If series has 0006-... but file is 006-...:
cd debian/patches
mv 006-avfilter-cve-2023-00009.patch 0006-avfilter-cve-2023-00009.patch
Batch rename if needed:
for f in 00[0-9]-*.patch; do
new=$(echo $f | sed 's/^00\(0\)/000\1/')
mv "$f" "$new"
done
If error shows "Reversed (or previously applied) patch detected", the fix is already in the base code.
Verify by checking the relevant source file:
grep -n "expected_fix_pattern" libavfilter/some_file.c
If the fix exists:
debian/patches/series (delete that line)If a patch is referenced but missing, download from upstream commit:
First, find the commit SHA from:
Download patch using GitHub:
curl -s "https://github.com/ffmpeg/ffmpeg/commit/<commit-sha>.patch" -o debian/patches/XXXX-cve-name.patch
Or using git format-patch:
git format-patch -1 <commit-sha> --stdout > debian/patches/XXXX-cve-name.patch
If a patch fails due to line offset (hunk #X FAILED):
cat debian/patches/XXXX-cve-name.patch
Find the line where the hunk begins (e.g., @@ -832,6 +832,7 @@)
View the actual source file around that line:
sed -n '820,860p' path/to/source/file.c
Test patch application without making changes:
dpkg-source --before-build . 2>&1
Or test individual patch:
patch -p1 --dry-run < debian/patches/XXXX-cve-name.patch
If successful, you should see:
patching file libavfilter/some_file.c
If failed, re-examine the error and adjust.
Once all patches apply:
git add debian/patches/
git commit -m "fix(cve): update patch filenames and adjust for CVE-XXXX
- Fixed patch file naming (leading zeros)
- Removed CVE-XXXX patch (fix already in base code)
- Adjusted CVE-YYYY patch for code offset compatibility"
Push to your branch:
git push fork HEAD:<branch-name>
For FFmpeg specifically, patches can be downloaded from upstream commits:
# List of CVE commits (example format)
CVE_COMMITS=(
"CVE-2023-50009:c443658d26d2b8e19901f9507a890e0efca79056:006:avfilter"
"CVE-2023-49501:4adb93dff05dd947878c67784d98c9a4e13b57a7:007:avfilter"
"CVE-2023-49528:2d9ed64859c9887d0504cd71dbd5b2c15e14251a:008:avfilter"
)
for ITEM in "${CVE_COMMITS[@]}"; do
IFS=':' read -r CVE COMMIT NUM COMPONENT <<< "$ITEM"
PATCH_FILE="debian/patches/${NUM}-${COMPONENT}-$(echo $CVE | tr '[:upper:]' '[:lower:]').patch"
curl -s "https://github.com/ffmpeg/ffmpeg/commit/$COMMIT.patch" > "$PATCH_FILE"
done
| Action | Command |
|--------|---------|
| List patches | ls debian/patches/ |
| View series | cat debian/patches/series |
| Test all patches | dpkg-source --before-build . |
| Test single patch | patch -p1 --dry-run < patchfile |
| Apply single patch | patch -p1 < patchfile |
| Check git status | git status |
| View patch content | cat debian/patches/XXXX.patch |
--dry-run or dpkg-source --before-buildquilt edit, quilt refresh for complex patch adjustmentstools
Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Claude ('No, that's wrong...', 'Actually...'), (3) User requests a capability that doesn't exist, (4) An external API or tool fails, (5) Claude realizes its knowledge is outdated or incorrect, (6) A better approach is discovered for a recurring task. Also review learnings before major tasks.
development
Convert Jenkins v25-crp_info_collect job output to Excel (.xlsx) format. Use when the user needs to extract theme information from Jenkins CRP (Code Review Platform) info collection jobs and convert it to a structured Excel file with columns for 主题名称, 主题地址, 仓库, 源码名及版本, 责任人. Works with job URLs like https://jenkinswh.uniontech.com/view/ISO-Builder/job/v25-repo-iso-work/view/repo/job/v25-crp_info_collect/
data-ai
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
tools
A CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.