Skip to content

feat(tools): classify-refs — NVD reference URL classifier with 89 tests - #166

Open
manus-use wants to merge 1 commit into
mainfrom
feat/classify-references
Open

feat(tools): classify-refs — NVD reference URL classifier with 89 tests#166
manus-use wants to merge 1 commit into
mainfrom
feat/classify-references

Conversation

@manus-use

Copy link
Copy Markdown
Owner

Summary

New tool and CLI subcommand that fetches NVD reference URLs for a CVE and classifies each into actionable categories for triage workflows.

Motivation

During vulnerability triage, analysts need to quickly identify which NVD references contain actionable patch information vs. background reading. Currently this requires manually inspecting each URL. This tool automates the classification using a multi-tier heuristic system.

Features

CLI Subcommand: classify-refs

# Text output with Rich formatting
manus-agent classify-refs CVE-2024-3094

# JSON for piping
manus-agent classify-refs CVE-2024-3094 --output json | jq .actionable

# Filter by category
manus-agent classify-refs CVE-2024-3094 --category patch

Strands Tool: classify_references

Available as an agentic tool for automated workflows — accepts a CVE ID and returns structured classification data.

Categories

Category Description
patch Fix commit, PR, or release containing the fix
advisory Vendor or coordinator security advisory (GHSA, DSA, USN, etc.)
exploit Public exploit or PoC code
mailing_list Security mailing list post (oss-security, fulldisclosure, etc.)
issue_tracker Bug tracker issue or pull request discussion
vendor_notice Vendor blog, changelog, or release notes
media News article, blog post, or analysis
other Uncategorized reference

Classification Priority

  1. Path patterns (high confidence) — GitHub commits/PRs/releases, GitLab commits, GHSA, Bugzilla, JIRA, Debian DSA/DLA
  2. Domain heuristics (high confidence) — exploit-db, seclists, cert.org, CISA, Red Hat, etc.
  3. NVD tags (medium confidence) — Patch, Exploit, Third Party Advisory, etc.
  4. Fallback keywords (low confidence) — /commit/, /advisory/, /issues/ in path

Output includes

  • Confidence level per reference (high/medium/low)
  • Summary counts per category
  • Actionable references extracted (high/medium confidence patches + advisories)

Tests

89 new tests covering:

  • URL classification logic (path patterns, domain rules, NVD tags, fallbacks)
  • CVE reference pipeline integration (mocked NVD API)
  • Strands tool interface (valid/invalid input, error handling)
  • CLI subcommand (parser, text/json output, category filtering, error paths)
  • Edge cases (empty refs, unicode, very long URLs, query params, ports)

All tests 100% mocked — no real HTTP calls.

Files Changed

  • src/manus_agent/tools/classify_references.py — new tool module
  • src/manus_agent/cli.pyclassify-refs subcommand dispatch + _run_classify_refs
  • tests/test_classify_references.py — 89 tests

…sifier

Add a new tool and CLI subcommand that fetches NVD reference URLs for a CVE
and classifies each into actionable categories:

  patch         — Fix commit, PR, or release containing the fix
  advisory      — Vendor or coordinator security advisory
  exploit       — Public exploit or PoC code
  mailing_list  — Security mailing list post
  issue_tracker — Bug tracker issue or pull request discussion
  vendor_notice — Vendor blog, changelog, or release notes
  media         — News article, blog post, or analysis
  other         — Uncategorized reference

Classification uses a 4-tier priority system:
1. Path patterns (GitHub commits, PRs, GHSA, Bugzilla, etc.)
2. Domain heuristics (exploit-db, seclists, cert.org, etc.)
3. NVD-provided tags (Patch, Exploit, Third Party Advisory, etc.)
4. Fallback keyword matching (low confidence)

Each classified reference includes confidence level (high/medium/low),
extracted source domain, and original NVD tags.

CLI usage:
  manus-agent classify-refs CVE-2024-3094
  manus-agent classify-refs CVE-2024-3094 --output json
  manus-agent classify-refs CVE-2024-3094 --category patch

Also usable as a Strands tool (classify_references) for agentic workflows.

Test suite: 89 tests covering URL classification logic, pipeline integration,
Strands tool interface, CLI parser and execution, and edge cases.
All tests 100% mocked — no real HTTP calls.
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