How to Check Your Python Dependencies for Vulnerabilities

How to Check Your Python Dependencies for Vulnerabilities

Python Tip: Use pip-audit to check your local Python project dependancies for vulerabilities.

Heres how 👇

# Install
python -m pip install pip-audit

# Scan
pip-audit
# or, if you have a requirements.txt file
pip-audit -r requirements.txt
# Output:
# Found 2 known vulnerabilities in 1 package
# Name    Version    ID                  Fix Versions
# ----    -------    --                  ------------
# Flask   0.5        PYSEC-2019-179      1.0
# Flask   0.5        PYSEC-2018-66       0.12.3

# Fix
pip-audit --fix

Subscribe to our newsletter and stay updated.

Don't miss anything. Get all the latest posts delivered straight to your inbox.
Great! Check your inbox and click the link to confirm your subscription.
Error! Please enter a valid email address!