-
Notifications
You must be signed in to change notification settings - Fork 0
security: supply chain package guard #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| name: Supply Chain Package Guard | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - '**/requirements*.txt' | ||
| - '**/pyproject.toml' | ||
| - '**/poetry.lock' | ||
| - '**/Pipfile.lock' | ||
| - '**/uv.lock' | ||
| - '**/setup.py' | ||
| - '**/setup.cfg' | ||
|
|
||
| jobs: | ||
| check-blocked-packages: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| BASE_SHA: ${{ github.event.pull_request.base.sha }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Check for compromised package versions | ||
| run: | | ||
| BLOCKED=0 | ||
|
|
||
| echo "=== Checking for compromised litellm versions ===" | ||
|
|
||
| CHANGED_FILES=$(git diff --name-only "$BASE_SHA"..HEAD -- \ | ||
| '**requirements*.txt' '**pyproject.toml' '**poetry.lock' \ | ||
| '**Pipfile.lock' '**uv.lock' '**setup.py' '**setup.cfg' 2>/dev/null || true) | ||
|
|
||
| for f in $CHANGED_FILES; do | ||
| [ -f "$f" ] || continue | ||
|
|
||
| if grep -qiE 'litellm[>=!~]' "$f"; then | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bare litellm dependency bypasses the security guardHigh Severity The regex There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Python extras syntax bypasses litellm dependency detectionHigh Severity The regex |
||
| if grep -qE 'litellm==1\.78\.2' "$f"; then | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Comment containing safe version defeats the guard checkMedium Severity The safe-version check |
||
| echo "OK: $f has litellm pinned to safe version 1.78.2" | ||
| else | ||
| echo "BLOCKED: $f contains litellm dependency NOT pinned to ==1.78.2" | ||
| echo " litellm 1.82.7/1.82.8 are compromised (TeamPCP, Mar 2026)" | ||
| echo " Pin to litellm==1.78.2 or remove the dependency" | ||
| grep -n 'litellm' "$f" || true | ||
| BLOCKED=1 | ||
| fi | ||
| fi | ||
| done | ||
|
|
||
| if [ "$BLOCKED" -eq 1 ]; then | ||
| echo "" | ||
| echo "================================================================" | ||
| echo "SUPPLY CHAIN GUARD: PR blocked due to compromised package risk" | ||
| echo "================================================================" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "All dependency files clean." | ||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Git diff failure silently bypasses entire security guard
High Severity
The
2>/dev/null || trueon thegit diffcommand means any failure (invalidBASE_SHA, corrupt ref, race condition) is silently swallowed. Since GitHub Actions runs withbash -eby default, the|| trueprevents the step from exiting — butCHANGED_FILESends up empty, no files are scanned, and the workflow reports "All dependency files clean." This is a fail-open design in a security guard, allowing compromised packages through whenever the diff command fails.