Skip to main content

fix-python

Apply a Python dependency CVE fix: bump requirements pin, regenerate requirements-build.txt with pybuild-deps, verify with pip-audit.

소스 정보

저장소
quay/ai-helpers
최근 소스 활동
2026년 6월 24일 14:14
감지된 SKILL.md 언어
영어
스타
3
포크
11

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
fix-python
description
Apply a Python dependency CVE fix: bump requirements pin, regenerate requirements-build.txt with pybuild-deps, verify with pip-audit.
allowed-tools
["Bash(pybuild-deps *)","Bash(pip-audit *)","Bash(pip *)","Bash(pip3 *)","Bash(sed *)","Bash(grep *)","Bash(cat *)","Read","Write","Edit","Glob","Grep"]
# Fix Python CVE ## Inputs | Input | Required | |-------|----------| | `PACKAGE` | yes | | `FIXED_VERSION` | yes | | `CVE_ID` | yes | | `REPO_DIR` | yes (cwd) | | `CVE_PYBUILD_SETUPTOOLS_WORKAROUND` | optional, default false | ## Steps ### 1. Find requirements file ```bash REQ_FILE="" for f in requirements.txt requirements-dev.txt; do if grep -qi "^${PACKAGE}" "$f" 2>/dev/null; then REQ_FILE="$f" break fi done ``` ### 2. Bump version pin ```bash ESCAPED_PACKAGE=$(printf '%s\n' "$PACKAGE" | sed 's/[.[\*^$]/\\&/g') sed -i "s/^${ESCAPED_PACKAGE}[=>~!][=<>~!]*.*$/${PACKAGE}>=${FIXED_VERSION}/" "$REQ_FILE" ``` ### 3. Regenerate requirements-build.txt ```bash pybuild-deps compile --generate-hashes --output-file=requirements-build.txt requirements.txt if [ "${CVE_PYBUILD_SETUPTOOLS_WORKAROUND:-false}" = "true" ]; then sed -i '/^setuptools==82\b/d' requirements-build.txt fi ``` ### 4. Verify ```bash grep "${PACKAGE}" requirements-build.txt pip-audit -r requirements.txt 2>/dev/null | grep -i "${CVE_ID}" && \ echo "WARNING: CVE still detected" || echo "CVE resolved in scan" ``` ## Output Modified `requirements*.txt` and `requirements-build.txt` in `REPO_DIR`.
GitHub에서 보기