Skip to content

feat(tools): get_version_range — CVE affected version range resolver + CLI subcommand (+85 tests) - #54

Open
manus-use wants to merge 1 commit into
mainfrom
feat/version-range
Open

feat(tools): get_version_range — CVE affected version range resolver + CLI subcommand (+85 tests)#54
manus-use wants to merge 1 commit into
mainfrom
feat/version-range

Conversation

@manus-use

@manus-use manus-use commented Jun 27, 2026

Copy link
Copy Markdown
Owner

Summary

Implements the get_version_range tool and manus-agent version-range CLI subcommand — a README-documented feature that had zero implementation (no tool file, no CLI dispatch, no tests).

What it does

Resolves a CVE to its affected version ranges per ecosystem and package by:

  1. NVD CPE configurations — walks configurations[].nodes[].cpeMatch[] to extract versionStartIncluding, versionEndExcluding, etc. into structured range tuples
  2. OSV.dev package ranges — fetches per-package affected[].ranges[].events with introduced/fixed/last_affected and concrete version lists; follows GHSA aliases when the CVE record lacks package-level data
  3. Merges and deduplicates — presents a unified view grouped by ecosystem+package with human-readable range descriptions

CLI usage (matches README docs)

manus-agent version-range CVE-2021-44228
manus-agent version-range CVE-2021-44228 --ecosystem pypi
manus-agent version-range CVE-2021-44228 --output json | jq .first_patched_version

Ecosystem support

Supports filtering by: auto (all), pypi, npm, maven, go, cargo, nuget, rubygems, composer. Normalises aliases (e.g., "python" → PyPI, "node" → npm, "rust" → crates.io).

Design

  • Zero new dependencies — uses only requests (already in deps)
  • Retry/back-off on all HTTP (configurable via VERSION_RANGE_MAX_RETRIES, VERSION_RANGE_RETRY_BASE_DELAY env vars)
  • NVD_API_KEY support for higher rate limits
  • Graceful degradation — returns partial results when one source fails
  • Strands TOOL_SPEC interface — consistent with all other tools in the repo
  • GHSA alias following — recovers package-level data when CVE record is sparse (capped at 8 aliases)

Test coverage

85 fully-mocked tests covering:

  • TOOL_SPEC contract (4)
  • Input validation (5)
  • HTTP retry logic (5)
  • NVD CPE range parsing (8)
  • NVD range formatting (5)
  • OSV affected parsing (7)
  • Ecosystem normalisation (7)
  • Ecosystem filtering (5)
  • Range description builder (5)
  • fetch_version_range integration (5)
  • OSV fetch with alias following (3)
  • NVD fetch (4)
  • Text formatting (5)
  • JSON output (1)
  • Strands tool handler (4)
  • CLI subcommand (5)
  • Edge cases (6)

Full test suite: 1243 passed, 0 failures.

Files changed

  • src/manus_agent/tools/get_version_range.py (new — tool implementation)
  • src/manus_agent/cli.py (dispatch + parser + _SUBCOMMANDS)
  • tests/test_version_range.py (new — 85 tests)

Duplicate check

Checked all 50 open PRs (#137#186) and 30 most recent merged PRs. No existing open or merged PR implements version-range. Closest PRs reviewed:

manus-use pushed a commit that referenced this pull request Jun 29, 2026
…n PRs roadmap, and changelog section

- poc-search subcommand (PR #62): multi-source PoC aggregator (trickest, VulnCheck KEV, Exploit-DB, GitHub, NVD)
- changelog subcommand (PR #66): conventional-commit release automation
- VulnCheck enrichment section: VULNCHECK_API_KEY optional, vulncheck-kev + nist-nvd2 indexes
- Updated 8-step VI pipeline description to include VulnCheck KEV in step 2, patch diff/exploit complexity/version range in step 6
- Coming Soon table: 9 open PRs (#51 silent-patches, #53 cve-timeline, #54 version-range, #58 vendor-response, #60 poc-freshness, #63 blast-radius, #64 sbom-scan, #65 temporal-priority, #67 cluster-variants)
- Updated built-in tools list to mention VulnCheck KEV and new VI tools
- Added Changelog section linking to CHANGELOG.md
- Updated Table of Contents with Changelog entry
- Expanded Security examples to include poc-search and changelog
@manus-use
manus-use force-pushed the feat/version-range branch from 93e789e to ef44783 Compare July 3, 2026 00:12
@manus-use manus-use changed the title feat(tools): affected-version range resolver (manus-use version-range) feat(tools): version range analyzer — get_version_range tool + manus-agent version-range CLI Jul 3, 2026
@manus-use manus-use changed the title feat(tools): version range analyzer — get_version_range tool + manus-agent version-range CLI feat(tools): get_version_range — NVD CPE + OSV.dev affected version resolver + CLI subcommand (+74 tests) Aug 12, 2026
@manus-use manus-use changed the title feat(tools): get_version_range — NVD CPE + OSV.dev affected version resolver + CLI subcommand (+74 tests) feat(tools): get_version_range — CVE affected version range resolver + CLI subcommand (+85 tests) Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant