Skip to main content

VulnLens

CI PyPI Python 3.10+ License: MIT

A security scanner that tells you which findings actually matter.

Live demo · PyPI · GitHub Marketplace

VulnLens scans your code (Semgrep), dependencies (OSV.dev) and secrets (TruffleHog), then ranks every finding by evidence that attackers are using it:

  • CISA KEV: is this CVE being exploited in the wild right now?
  • EPSS: how likely is exploitation in the next 30 days?
  • CVSS: how bad is it if it happens?
  • Secret verification: does the leaked key still work?

Each finding goes into one of three tiers:

Tier What goes there
Act now A CVE in CISA KEV or with high EPSS in a runtime dependency, a live secret, or a flaw confirmed by AI triage
Review A signal in shipped code that needs a person to judge it
Context The same signals in tests, examples, docs, vendored code or dev dependencies

Quickstart

pip install "vulnlens[semgrep]"
vulnlens doctor                     # checks the engines and shows how to install anything missing
vulnlens scan .
vulnlens scan . --html report.html  # interactive report in one offline file

TruffleHog is a separate binary; vulnlens doctor tells you which release file to download.

VulnLens dashboard for OWASP PyGoat

A scan of OWASP PyGoat, an intentionally vulnerable app: 273 findings, 11 to act on now, with the actively exploited Pillow CVE ranked first. More screenshots: light mode · findings · upgrade plan

$ vulnlens scan https://github.com/adeyosemanputra/pygoat

  Grade:  F    273 findings
  Act now: 11   Review: 242   Context: 20
  1 actively exploited (CISA KEV)

  Upgrade plan: 21 upgrade(s) resolve 186 dependency finding(s)
    P0 Pillow 9.4.0 -> 12.3.0  (19 vuln(s))  KEV  requirements.txt
    P1 Django 4.2 -> 5.2.17  (51 vuln(s))  requirements.txt

  Act now (11)
   1. P0 Pillow 9.4.0: libwebp: OOB write in BuildHuffmanTable
      requirements.txt:19  [osv: GHSA-j7hp-h8jx-5ppr]
      - In CISA KEV: actively exploited in the wild (listed 2023-09-13)
      - EPSS: 99.98% chance of exploitation in the next 30 days
      - CVSS 8.8 (high)
      - Fix: upgrade Pillow to 10.0.1 or later

GitHub Action

# .github/workflows/vulnlens.yml
name: VulnLens
on:
  push:
    branches: [main]
  pull_request:
permissions:
  contents: read
  security-events: write   # upload results to Security → Code scanning
jobs:
  scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: harishakshay/open-source-vulnerability-scanner@v0
        with:
          fail-on: act     # fail on Act-now findings; `review` is stricter

The Action installs VulnLens, Semgrep and TruffleHog (checksum-verified), runs the scan, writes a job summary and uploads SARIF. In Security → Code scanning, Act-now findings show as errors, Review as warnings and Context as notes.

Input Default
path . directory to scan
fail-on never act, review, or a priority P0-P4
engines code,deps,secrets
baseline an earlier JSON report; only new findings count
upload-sarif true needs security-events: write
semgrep-config p/default

Outputs: act, review, context, grade, sarif-file. Use @v0 for the latest 0.x release or @v0.3.1 to pin one.

How findings are ranked

Priority Meaning Rule
P0 Fix now CVE in CISA KEV, or a verified live secret
P1 Fix this sprint EPSS ≥ 10%, CVSS ≥ 9.0, or a high-severity code flaw that is high-confidence or flagged by two rule families
P2 Plan a fix High severity, or EPSS ≥ 1%
P3 Low Medium severity, or an unverified secret
P4 Informational Everything else

Findings in tests, examples, docs, vendored code and dev dependencies are capped at P3. Every finding lists the reasons for its priority. The same CVE under different IDs (GHSA, PYSEC, CVE) is reported once, and so is a package pinned in several lockfiles. The upgrade plan picks the smallest version that fixes everything found for each package.

The rules are in vulnlens/priority.py.

AI triage (optional)

pip install "vulnlens[ai]"
export ANTHROPIC_API_KEY=...
vulnlens scan . --ai-dry-run     # shows the estimated cost, sends nothing
vulnlens scan . --ai-triage

Claude (Haiku by default) reads each code finding with the surrounding code and answers: real, false positive or needs review, with a reason and a suggested fix. Confirmed findings move up; confident false positives drop to P3, never lower. Code is redacted before it is sent and secret findings are never sent. Verdicts are cached, and triage stops if the estimate is above --ai-max-cost ($2 by default).

On a 54-finding labeled benchmark, it removed 61% of the false positives and dismissed none of the 26 real issues, for $0.035.

Usage

vulnlens scan https://github.com/owner/repo         # scan a public repo
vulnlens scan . --sarif results.sarif --json report.json
vulnlens scan . --fail-on act                       # exit 1 on Act-now findings
vulnlens scan . --baseline main.json --fail-on act  # only fail on new findings
vulnlens scan . --engines deps                      # dependencies only
vulnlens scan . --exclude 'tests/**'
vulnlens serve                                      # local dashboard at http://localhost:8765
vulnlens html a.json b.json -o report.html          # combine saved reports into one page

Silencing findings: add path globs, rule:, id: or fingerprint: lines (with an optional # reason) to a .vulnlensignore file, or put vulnlens: ignore on the flagged line. Suppressed findings are listed in the JSON report. When you scan someone else's repository, its own ignore rules are not applied.

Exit codes: 0 ok, 1 findings at or above --fail-on, 2 scan error. With --fail-on, an engine that didn't run is also an error, so CI never passes on a partial scan.

Supported dependency files: requirements*.txt, Pipfile.lock, poetry.lock, uv.lock, pyproject.toml, package-lock.json, npm-shrinkwrap.json, yarn.lock, pnpm-lock.yaml, go.mod, Cargo.lock, composer.lock, Gemfile.lock.

Limitations

  • A dependency finding means a vulnerable version is installed, not that your code calls the vulnerable function.
  • Java (pom.xml, Gradle), bun.lock and dependencies without an exact version aren't checked yet; reports list them under "Not checked".
  • Semgrep registry rules change over time, so results for the same commit can drift slightly.

More

pip install -e ".[dev]" && pytest   # development setup

MIT License.

Metadata

Release files for vulnlens 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vulnlens 0.3.1
File Size Uploaded Provenance Actions
vulnlens-0.3.1.tar.gz 461.3 kB With provenance Details for vulnlens-0.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vulnlens 0.3.1
File Interpreter ABI Platform Actions
vulnlens-0.3.1-py3-none-any.whl Python 3 none any Details for vulnlens-0.3.1-py3-none-any.whl

Total release size: 907.6 kB

Release files / vulnlens-0.3.1.tar.gz

Download URL vulnlens-0.3.1.tar.gz
Size 461.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c303eb229e25875faa48dc831f2a6a1a0455c324ab2dad31e40591995081e133
BLAKE2b-256 checksum
How to use checksums
b3688b8e36711729d84491ff2baa49048f659f550de0cf712aed9e6257a0308b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / vulnlens-0.3.1-py3-none-any.whl

Download URL vulnlens-0.3.1-py3-none-any.whl
Size 446.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5338bdd5ec35b364ce53b93ba47c67135f9b22412066340aa836f89041fb6325
BLAKE2b-256 checksum
How to use checksums
8a4b1bd44b82ec63be1e69fb92487ec6e53e85563b1917e98471cca2ceac2c6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Security for vulnlens 0.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for vulnlens-0.3.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page