Skip to content

Instantly share code, notes, and snippets.

@sinedied
Last active March 31, 2026 08:42
Show Gist options
  • Select an option

  • Save sinedied/5de454c07042f5e9b231b0d62da7b30f to your computer and use it in GitHub Desktop.

Select an option

Save sinedied/5de454c07042f5e9b231b0d62da7b30f to your computer and use it in GitHub Desktop.
Check for vulnerable axios package in your repos
#!/usr/bin/env bash
# Usage: ./check-axios.sh [directory]
# Scans all repos in the given directory (default: current) for compromised axios versions.
# You can run it directly from gist with:
# curl -sL https://gist.githubusercontent.com/sinedied/5de454c07042f5e9b231b0d62da7b30f/raw/check-axios.sh | bash -s
#
# A Powershell version of this script is also available here:
# https://gist.github.com/cmaneu/87de57c7d3b79aa2a58b6b661d739fe9
set -euo pipefail
dir="${1:-.}"
for repo in "$dir"/*/; do
[ -f "$repo/package.json" ] || continue
matches=$(cd "$repo" && npm ls axios 2>/dev/null | grep -E 'axios@(1\.14\.1|0\.30\.4)' || true)
if [ -n "$matches" ]; then
echo ""
echo "############################################"
echo "## COMPROMISED AXIOS VERSION DETECTED !!! ##"
echo "############################################"
echo ""
echo "Repository: $repo"
echo "$matches"
echo ""
exit 1
fi
done
echo "All clean, no compromised axios versions found."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment