CVE
Look up CVE records, flag known-exploited CVEs, score exploit likelihood, find open-source package advisories, and compute CVSS v3.1 scores
- Connector software
- Free and open source
- Service credentials
- Not needed
- Query Farm hosting
- Available Β· $10/month organization minimum
Use with an agent
Install the Orchard skill in your project to help your agent find connectors, configure them, and verify SQL results.
npx skills add Query-farm/vgi-skills --skill orchard
Copy this request into your coding agent to get started.
Use https://query.farm/products/orchard/connectors/cve/index.md to help me query CVE with DuckDB or Haybarn 2.0.1 and VGI protocol 3.4. Ask only for missing details about the result I need or whether I want local execution, self-hosting or Query Farm hosting. Check the connector's actual hosting availability, credentials and input requirements. Read one format of each needed reference and the exact object declarations before writing SQL. Use a released connector, and distinguish a saved example result from anything you actually execute. If you cannot run the query, tell me what remains to verify.
See what you can query
Example output Β· captured
- Connector release
- v0.6.0
- Engine
- 2.0.1
- VGI protocol
- 3.4.0
WITH inventory(asset, vector) AS (VALUES ('web-01', 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'), ('db-01', 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N'), ('kiosk-01', 'CVSS:3.1/AV:P/AC:H/PR:H/UI:R/S:U/C:L/I:N/A:N'), ('app-02', 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H')), scored AS (SELECT asset, cve.main.cvss_base_score(vector) AS base_score FROM inventory) SELECT b.severity, count(s.asset) AS assets, string_agg(s.asset, ', ' ORDER BY s.asset) AS asset_list
FROM cve.main.cvss_severity_bands b
LEFT JOIN scored s ON s.base_score BETWEEN b.min_score AND b.max_score
GROUP BY b.severity, b.min_score
ORDER BY b.min_score;
| severity | assets | asset_list |
|---|---|---|
| NONE | 0 | NULL |
| LOW | 1 | kiosk-01 |
| MEDIUM | 0 | NULL |
| HIGH | 1 | db-01 |
| CRITICAL | 2 | app-02, web-01 |
Quick start
Choose where to run CVE, then follow the steps below.
The connector runs alongside DuckDB or Haybarn. No Query Farm account is needed.
1. Install the vgi extension
Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;
INSTALL vgi FROM community;
LOAD vgi;
2. Attach the connector
Attach the release directly
Downloads the latest release for your platform and caches it locally.
ATTACH 'cve' AS cve (
TYPE vgi,
LOCATION 'github-auto://Query-farm/vgi-cve'
);
Attach the signed image
Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.
ATTACH 'cve' AS cve (
TYPE vgi,
LOCATION 'oci://ghcr.io/query-farm/vgi-cve:0.6.0'
);
3. Run a query
WITH inventory(asset, vector) AS (VALUES ('web-01', 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'), ('db-01', 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N'), ('kiosk-01', 'CVSS:3.1/AV:P/AC:H/PR:H/UI:R/S:U/C:L/I:N/A:N'), ('app-02', 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H')), scored AS (SELECT asset, cve.main.cvss_base_score(vector) AS base_score FROM inventory) SELECT b.severity, count(s.asset) AS assets, string_agg(s.asset, ', ' ORDER BY s.asset) AS asset_list
FROM cve.main.cvss_severity_bands b
LEFT JOIN scored s ON s.base_score BETWEEN b.min_score AND b.max_score
GROUP BY b.severity, b.min_score
ORDER BY b.min_score;
Run the connector on a server you manage. You operate the service and choose who can connect.
1. Deploy the connector on your server
Follow the connectorβs deployment instructions. Use its supported HTTP transport, or launch it remotely over SSH. The connection guide explains both options.
2. Install the vgi extension
Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;
INSTALL vgi FROM community;
LOAD vgi;
3. Attach the connector
For an HTTP deployment, replace the example URL with your endpoint. Add the authentication options your deployment requires. For SSH, use the SSH connection instructions.
ATTACH 'cve' AS cve
(TYPE vgi, LOCATION 'https://your-connector.example.com');
4. Run a query
WITH inventory(asset, vector) AS (VALUES ('web-01', 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'), ('db-01', 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N'), ('kiosk-01', 'CVSS:3.1/AV:P/AC:H/PR:H/UI:R/S:U/C:L/I:N/A:N'), ('app-02', 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H')), scored AS (SELECT asset, cve.main.cvss_base_score(vector) AS base_score FROM inventory) SELECT b.severity, count(s.asset) AS assets, string_agg(s.asset, ', ' ORDER BY s.asset) AS asset_list
FROM cve.main.cvss_severity_bands b
LEFT JOIN scored s ON s.base_score BETWEEN b.min_score AND b.max_score
GROUP BY b.severity, b.min_score
ORDER BY b.min_score;
Query Farm operates CVE for your team. Hosting has a $10 monthly minimum per organization; usage counts toward it. From $2.97 per instance-month ($10 monthly minimum).
1. Create your hosted connector
Open the console, choose your organization and deployment size, and add any service credentials there.
2. Install the vgi extension
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;
INSTALL vgi FROM community;
LOAD vgi;
3. Attach your deployment
Copy the ATTACH statement from your deployment in the console and run it in DuckDB or Haybarn. Use cve as the catalog alias for the query below.
4. Run a query
WITH inventory(asset, vector) AS (VALUES ('web-01', 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'), ('db-01', 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N'), ('kiosk-01', 'CVSS:3.1/AV:P/AC:H/PR:H/UI:R/S:U/C:L/I:N/A:N'), ('app-02', 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H')), scored AS (SELECT asset, cve.main.cvss_base_score(vector) AS base_score FROM inventory) SELECT b.severity, count(s.asset) AS assets, string_agg(s.asset, ', ' ORDER BY s.asset) AS asset_list
FROM cve.main.cvss_severity_bands b
LEFT JOIN scored s ON s.base_score BETWEEN b.min_score AND b.max_score
GROUP BY b.severity, b.min_score
ORDER BY b.min_score;
Technical details
- Verified connector release
- v0.6.0
- Engine
- 2.0.1
- VGI protocol
- 3.4.0
- Verified on
- December 1, 2026
Pin a version for production
When running the connector yourself, keep a specific release until youβre ready to upgrade. Replace the ATTACH statement above with this one and follow the same extension and credential setup.
Attach the release directly
Uses the verified release each time you attach the connector.
ATTACH 'cve' AS cve (
TYPE vgi,
LOCATION 'github-auto://Query-farm/[email protected]'
);
Attach the signed image
Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.
ATTACH 'cve' AS cve (
TYPE vgi,
LOCATION 'oci://ghcr.io/query-farm/vgi-cve:0.6.0'
);
Overview
Look up and prioritize CVEs: NVD records, CISA KEV, FIRST EPSS, OSV.dev, and offline CVSS scoring
Query CVE / vulnerability data and compute CVSS v3.1 severity scores directly in SQL. The cve extension turns DuckDB into a defensive vulnerability-management workbench: resolve advisories, search vulnerability descriptions, map products to the vulnerabilities that affect them, and score CVSS vectors offline β all without leaving your query editor.
This worker is built for security engineers, vulnerability-management and patch teams, threat researchers, and data analysts who need to enrich, triage, and report on software vulnerabilities at SQL speed. The live lookups read from the National Vulnerability Database (NVD) 2.0 REST API, which republishes and enriches the public CVE records curated by the MITRE-led CVE Program. The scoring math is a faithful, dependency-free implementation of the CVSS v3.1 base-metric equation maintained by FIRST, so a vector string always maps to the same base score and qualitative severity band that the official calculator produces.
The extension is organized in two complementary halves. Offline CVSS scoring runs with no network access at all: it parses a CVSS:3.1 vector string into its numeric base score and buckets any numeric score into its qualitative band (NONE, LOW, MEDIUM, HIGH, or CRITICAL), fully deterministic and safe for air-gapped or high-volume pipelines. Live NVD 2.0 lookups stream vulnerability records from the National Vulnerability Database and accept optional base_url and api_key arguments so you can target a mirror or raise NVD rate limits with a personal key.
Severity alone is a poor patch-priority signal, so the worker also brings exploit intelligence: the CISA Known Exploited Vulnerabilities (KEV) catalog of CVEs with evidence of active exploitation (US government work, public domain), and FIRST's Exploit Prediction Scoring System (EPSS) probability that a CVE is exploited in the next 30 days. For open-source dependencies, OSV.dev lookups list the advisories (GitHub Security Advisories, PyPI, Go, RustSec, npm, Maven and more) affecting a package version along with the versions that fix them (OSV data is CC-BY-4.0). Every network function takes an optional base_url override, and all of them join on the CVE id.
Reach for this worker whenever you need to attach severity to raw CVSS vectors, look up the details of a known advisory, discover vulnerabilities by keyword or by affected product, or join vulnerability data against your own asset inventory. CVEs still under analysis surface a SQL NULL score rather than a misleading zero.
Learn more
- CVSS specification and scoring (FIRST): first.org/cvss β CVSS v3.1 specification document and the official CVSS v3.1 calculator.
- CVE records and program (MITRE): cve.org β source data in the CVE List repository.
- CISA KEV catalog: cisa.gov/known-exploited-vulnerabilities-catalog.
- EPSS (FIRST): first.org/epss and its API.
- OSV.dev: osv.dev and its API docs.
- This worker's source: github.com/Query-farm/vgi-cve.
Catalog
Everything cve exposes once attached β read straight from the worker's
released build.
main 1 table Β· 10 functions
CVE lookup (NVD, CISA KEV, FIRST EPSS, OSV.dev) and CVSS v3.1 scoring functions.
Schema examples (14)
Compute the CVSS v3.1 base score for the Log4Shell vector.
SELECT cve.main.cvss_base_score('CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H');
Map a numeric CVSS base score to its qualitative severity band.
SELECT cve.main.cvss_severity(9.8);
Browse the CVSS severity bands with their inclusive base-score ranges.
SELECT severity, min_score, max_score
FROM cve.main.cvss_severity_bands
ORDER BY min_score;
Look up the Log4Shell CVE and keep only its critical-severity scoring.
SELECT id, cvss_score, cvss_severity
FROM cve.main.cve('CVE-2021-44228')
WHERE cvss_score >= 9.0;
10 more examples
Rank the scored log4j CVEs by CVSS base score, most severe first.
SELECT id, cvss_score, cvss_severity
FROM cve.main.cve_search('log4j')
WHERE cvss_score IS NOT NULL
ORDER BY cvss_score DESC;
List the high/critical CVEs affecting Apache Log4j 2.14.1, worst first.
SELECT cve_id, description, cvss_score, cvss_severity
FROM cve.main.cpe_cves('cpe:2.3:a:apache:log4j:2.14.1:*:*:*:*:*:*:*')
WHERE cvss_severity IN ('HIGH', 'CRITICAL')
ORDER BY cvss_score DESC;
Score an inventory of CVSS v3.1 vectors offline and count the assets in each severity band, keeping empty bands as zero-count rows.
WITH inventory(asset, vector) AS (VALUES ('web-01', 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'), ('db-01', 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N'), ('kiosk-01', 'CVSS:3.1/AV:P/AC:H/PR:H/UI:R/S:U/C:L/I:N/A:N'), ('app-02', 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H')), scored AS (SELECT asset, cve.main.cvss_base_score(vector) AS base_score FROM inventory) SELECT b.severity, count(s.asset) AS assets, string_agg(s.asset, ', ' ORDER BY s.asset) AS asset_list
FROM cve.main.cvss_severity_bands b
LEFT JOIN scored s ON s.base_score BETWEEN b.min_score AND b.max_score
GROUP BY b.severity, b.min_score
ORDER BY b.min_score;
| severity | assets | asset_list |
|---|---|---|
| NONE | 0 | NULL |
| LOW | 1 | kiosk-01 |
| MEDIUM | 0 | NULL |
| HIGH | 1 | db-01 |
| CRITICAL | 2 | app-02, web-01 |
Re-score Log4Shell's NVD CVSS v3.1 vector offline and check it reproduces NVD's published base score.
SELECT id, cvss_vector, cvss_score AS nvd_score,
cve.main.cvss_base_score(cvss_vector) AS recomputed_score,
cvss_score = cve.main.cvss_base_score(cvss_vector) AS scores_agree
FROM cve.main.cve('CVE-2021-44228')
ORDER BY id;
Triage the log4j keyword-search hits: flag which ones NVD lists against the installed Apache Log4j 2.14.1 CPE, most severe first.
SELECT s.id, s.cvss_score, s.cvss_severity,
p.cve_id IS NOT NULL AS affects_2_14_1
FROM cve.main.cve_search('log4j') s
LEFT JOIN cve.main.cpe_cves('cpe:2.3:a:apache:log4j:2.14.1:*:*:*:*:*:*:*') p ON p.cve_id = s.id
ORDER BY s.cvss_score DESC NULLS LAST, s.id;
List the ten most recently added CISA KEV entries used in ransomware campaigns.
SELECT cve_id, vendor_project, product, date_added
FROM cve.main.kev()
WHERE known_ransomware_campaign_use = 'Known'
ORDER BY date_added DESC
LIMIT 10;
Get the EPSS exploitation probability and percentile for Log4Shell and Spring4Shell.
SELECT cve_id, epss, percentile
FROM cve.main.epss(['CVE-2021-44228', 'CVE-2022-22965'])
ORDER BY epss DESC;
List the OSV advisories affecting jinja2 2.4.1 with their fixed versions.
SELECT id, cve_ids, fixed_versions
FROM cve.main.osv_query('PyPI', 'jinja2', version := '2.4.1')
ORDER BY id;
Prioritize the CVEs affecting Apache Log4j 2.14.1: flag CISA known-exploited ones, attach EPSS exploitation probability, and rank exploited-first, then by EPSS and CVSS.
WITH n AS (SELECT cve_id, cvss_score, cvss_severity FROM cve.main.cpe_cves('cpe:2.3:a:apache:log4j:2.14.1:*:*:*:*:*:*:*')) SELECT n.cve_id, n.cvss_score, n.cvss_severity, k.cve_id IS NOT NULL AS in_kev, k.known_ransomware_campaign_use, e.epss, e.percentile
FROM n
LEFT JOIN cve.main.kev() k ON k.cve_id = n.cve_id
LEFT JOIN cve.main.epss(['CVE-2021-44228', 'CVE-2021-45046', 'CVE-2021-45105', 'CVE-2021-44832']) e ON e.cve_id = n.cve_id
ORDER BY in_kev DESC, e.epss DESC NULLS LAST, n.cvss_score DESC NULLS LAST, n.cve_id;
Find the OSV advisories affecting log4j-core 2.14.1, expand their CVE ids, and flag which are CISA known-exploited, with the versions that fix them.
WITH o AS (SELECT id, unnest(cve_ids) AS cve_id, database_severity, fixed_versions FROM cve.main.osv_query('Maven', 'org.apache.logging.log4j:log4j-core', version := '2.14.1')) SELECT o.id, o.cve_id, o.database_severity, k.cve_id IS NOT NULL AS in_kev, o.fixed_versions
FROM o
LEFT JOIN cve.main.kev() k ON k.cve_id = o.cve_id
ORDER BY in_kev DESC, o.id, o.cve_id;
cvss_severity_bands
The five CVSS v3.1 qualitative severity bands and the base-score range each covers.
List the high-and-above CVSS severity bands with their score ranges.
SELECT severity, min_score, max_score
FROM cve.main.cvss_severity_bands
WHERE min_score >= 7.0
ORDER BY min_score;
Band a numeric CVSS score by joining it against the reference ranges.
SELECT b.severity
FROM cve.main.cvss_severity_bands b
WHERE 7.5 BETWEEN b.min_score AND b.max_score;
Score an inventory of CVSS v3.1 vectors offline and count the assets in each severity band, keeping empty bands as zero-count rows.
WITH inventory(asset, vector) AS (VALUES ('web-01', 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'), ('db-01', 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N'), ('kiosk-01', 'CVSS:3.1/AV:P/AC:H/PR:H/UI:R/S:U/C:L/I:N/A:N'), ('app-02', 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H')), scored AS (SELECT asset, cve.main.cvss_base_score(vector) AS base_score FROM inventory) SELECT b.severity, count(s.asset) AS assets, string_agg(s.asset, ', ' ORDER BY s.asset) AS asset_list
FROM cve.main.cvss_severity_bands b
LEFT JOIN scored s ON s.base_score BETWEEN b.min_score AND b.max_score
GROUP BY b.severity, b.min_score
ORDER BY b.min_score;
| severity | assets | asset_list |
|---|---|---|
| NONE | 0 | NULL |
| LOW | 1 | kiosk-01 |
| MEDIUM | 0 | NULL |
| HIGH | 1 | db-01 |
| CRITICAL | 2 | app-02, web-01 |
cvss_base_score (vector VARCHAR)
Compute the CVSS v3.1 base score from a vector string
Compute the CVSS v3.1 base score for the Log4Shell vector (returns 9.8).
SELECT cve.main.cvss_base_score('CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H');
cvss_severity (score DOUBLE)
Map a CVSS base score (0.0-10.0) to NONE/LOW/MEDIUM/HIGH/CRITICAL
Map a numeric CVSS base score to its qualitative band (returns 'CRITICAL').
SELECT cve.main.cvss_severity(9.8);
cpe_cves (cpe VARCHAR, base_url := VARCHAR, api_key := VARCHAR)
List CVEs affecting a CPE name from the NVD 2.0 API (paginated, bounded)
List only the high/critical CVEs affecting Apache Log4j 2.14.1, worst first.
SELECT cve_id, description, cvss_score, cvss_severity
FROM cve.main.cpe_cves('cpe:2.3:a:apache:log4j:2.14.1:*:*:*:*:*:*:*')
WHERE cvss_severity IN ('HIGH', 'CRITICAL')
ORDER BY cvss_score DESC;
cve (cveid VARCHAR, base_url := VARCHAR, api_key := VARCHAR)
Fetch a single CVE record by ID from the NVD 2.0 API
Look up the Log4Shell CVE and keep only its critical-severity scoring and CWE.
SELECT id, cvss_score, cvss_severity, cwe
FROM cve.main.cve('CVE-2021-44228')
WHERE cvss_score >= 9.0;
Re-score Log4Shell's NVD CVSS v3.1 vector offline and check it reproduces NVD's published base score.
SELECT id, cvss_vector, cvss_score AS nvd_score,
cve.main.cvss_base_score(cvss_vector) AS recomputed_score,
cvss_score = cve.main.cvss_base_score(cvss_vector) AS scores_agree
FROM cve.main.cve('CVE-2021-44228')
ORDER BY id;
cve_search (keyword VARCHAR, base_url := VARCHAR, api_key := VARCHAR)
Keyword-search the NVD 2.0 API (paginated, bounded to 100 results)
Rank the scored 'log4j' CVEs by CVSS base score, most severe first.
SELECT id, cvss_score, cvss_severity
FROM cve.main.cve_search('log4j')
WHERE cvss_score IS NOT NULL
ORDER BY cvss_score DESC;
Triage the log4j keyword-search hits: flag which ones NVD lists against the installed Apache Log4j 2.14.1 CPE, most severe first.
SELECT s.id, s.cvss_score, s.cvss_severity,
p.cve_id IS NOT NULL AS affects_2_14_1
FROM cve.main.cve_search('log4j') s
LEFT JOIN cve.main.cpe_cves('cpe:2.3:a:apache:log4j:2.14.1:*:*:*:*:*:*:*') p ON p.cve_id = s.id
ORDER BY s.cvss_score DESC NULLS LAST, s.id;
epss (cvei_ds VARCHAR[], date := VARCHAR, base_url := VARCHAR)
Score CVEs with FIRST EPSS (probability of exploitation in the next 30 days)
Get today's EPSS exploitation probability and percentile for Log4Shell and Spring4Shell.
SELECT cve_id, epss, percentile, date
FROM cve.main.epss(['CVE-2021-44228', 'CVE-2022-22965'])
ORDER BY epss DESC;
Look up Log4Shell's historical EPSS score as published on 2023-03-01.
SELECT cve_id, epss, percentile
FROM cve.main.epss(['CVE-2021-44228'], date := '2023-03-01');
Prioritize the CVEs affecting Apache Log4j 2.14.1: flag CISA known-exploited ones, attach EPSS exploitation probability, and rank exploited-first, then by EPSS and CVSS.
WITH n AS (SELECT cve_id, cvss_score, cvss_severity FROM cve.main.cpe_cves('cpe:2.3:a:apache:log4j:2.14.1:*:*:*:*:*:*:*')) SELECT n.cve_id, n.cvss_score, n.cvss_severity, k.cve_id IS NOT NULL AS in_kev, k.known_ransomware_campaign_use, e.epss, e.percentile
FROM n
LEFT JOIN cve.main.kev() k ON k.cve_id = n.cve_id
LEFT JOIN cve.main.epss(['CVE-2021-44228', 'CVE-2021-45046', 'CVE-2021-45105', 'CVE-2021-44832']) e ON e.cve_id = n.cve_id
ORDER BY in_kev DESC, e.epss DESC NULLS LAST, n.cvss_score DESC NULLS LAST, n.cve_id;
kev (base_url := VARCHAR)
List the CISA Known Exploited Vulnerabilities (KEV) catalog
List the ten most recently added KEV entries that CISA knows are used in ransomware campaigns.
SELECT cve_id, vendor_project, product, date_added, due_date
FROM cve.main.kev()
WHERE known_ransomware_campaign_use = 'Known'
ORDER BY date_added DESC
LIMIT 10;
Rank the five vendors with the most known-exploited CVEs in the KEV catalog.
SELECT vendor_project, count(*) AS exploited_cves
FROM cve.main.kev()
GROUP BY vendor_project
ORDER BY exploited_cves DESC, vendor_project
LIMIT 5;
Prioritize the CVEs affecting Apache Log4j 2.14.1: flag CISA known-exploited ones, attach EPSS exploitation probability, and rank exploited-first, then by EPSS and CVSS.
WITH n AS (SELECT cve_id, cvss_score, cvss_severity FROM cve.main.cpe_cves('cpe:2.3:a:apache:log4j:2.14.1:*:*:*:*:*:*:*')) SELECT n.cve_id, n.cvss_score, n.cvss_severity, k.cve_id IS NOT NULL AS in_kev, k.known_ransomware_campaign_use, e.epss, e.percentile
FROM n
LEFT JOIN cve.main.kev() k ON k.cve_id = n.cve_id
LEFT JOIN cve.main.epss(['CVE-2021-44228', 'CVE-2021-45046', 'CVE-2021-45105', 'CVE-2021-44832']) e ON e.cve_id = n.cve_id
ORDER BY in_kev DESC, e.epss DESC NULLS LAST, n.cvss_score DESC NULLS LAST, n.cve_id;
kev_cve (cveid VARCHAR, base_url := VARCHAR)
Look up one CVE in the CISA KEV catalog (one row if listed, else none)
Check whether Log4Shell is in the CISA KEV catalog and show when it was added and its due date.
SELECT cve_id, vulnerability_name, date_added, due_date,
known_ransomware_campaign_use
FROM cve.main.kev_cve('CVE-2021-44228');
Answer yes/no: is CVE-2021-44228 a known exploited vulnerability?
SELECT count(*) > 0 AS is_known_exploited
FROM cve.main.kev_cve('CVE-2021-44228');
osv_query (ecosystem VARCHAR, name VARCHAR, version := VARCHAR, base_url := VARCHAR)
List OSV.dev vulnerabilities affecting an open-source package (optionally one version)
List the OSV advisories affecting jinja2 2.4.1 with their CVE ids and fixed versions.
SELECT id, cve_ids, database_severity, fixed_versions
FROM cve.main.osv_query('PyPI', 'jinja2', version := '2.4.1')
ORDER BY id;
Find the OSV advisories affecting log4j-core 2.14.1, expand their CVE ids, and flag which are CISA known-exploited, with the versions that fix them.
WITH o AS (SELECT id, unnest(cve_ids) AS cve_id, database_severity, fixed_versions FROM cve.main.osv_query('Maven', 'org.apache.logging.log4j:log4j-core', version := '2.14.1')) SELECT o.id, o.cve_id, o.database_severity, k.cve_id IS NOT NULL AS in_kev, o.fixed_versions
FROM o
LEFT JOIN cve.main.kev() k ON k.cve_id = o.cve_id
ORDER BY in_kev DESC, o.id, o.cve_id;
osv_vuln (id VARCHAR, base_url := VARCHAR)
Fetch one OSV.dev vulnerability record by id (GHSA-, PYSEC-, CVE-, GO-, RUSTSEC- ...)
Fetch the GitHub advisory for Log4Shell from OSV.dev with its CVE id, CVSS vector, and fixed versions.
SELECT id, summary, cve_ids, cvss_vector, affected_packages, fixed_versions
FROM cve.main.osv_vuln('GHSA-jfh8-c2jp-5v3q');
Score the CVSS v3 vector OSV.dev records for a jinja2 sandbox-escape advisory offline.
SELECT id, cvss_vector, cve.main.cvss_base_score(cvss_vector) AS base_score
FROM cve.main.osv_vuln('GHSA-462w-v97r-4m45');
Try these queries
Compute the CVSS v3.1 base score for the Log4Shell vector (9.8).
SELECT cve.main.cvss_base_score('CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H');
Uses cvss_base_score
Map a numeric CVSS base score to its qualitative severity band (CRITICAL).
SELECT cve.main.cvss_severity(9.8);
Uses cvss_severity
Browse the CVSS severity bands with their inclusive base-score ranges.
SELECT severity, min_score, max_score
FROM cve.main.cvss_severity_bands
ORDER BY min_score;
Uses cvss_severity_bands
Look up the Log4Shell CVE and keep only its critical-severity scoring.
SELECT id, cvss_score, cvss_severity
FROM cve.main.cve('CVE-2021-44228')
WHERE cvss_score >= 9.0;
Uses cve
Rank the scored log4j CVEs by CVSS base score, most severe first.
SELECT id, cvss_score, cvss_severity
FROM cve.main.cve_search('log4j')
WHERE cvss_score IS NOT NULL
ORDER BY cvss_score DESC;
Uses cve_search
List the high/critical CVEs affecting Apache Log4j 2.14.1, worst first.
SELECT cve_id, description, cvss_score, cvss_severity
FROM cve.main.cpe_cves('cpe:2.3:a:apache:log4j:2.14.1:*:*:*:*:*:*:*')
WHERE cvss_severity IN ('HIGH', 'CRITICAL')
ORDER BY cvss_score DESC;
Uses cpe_cves
1 more example Hide 1 more
Score a vector and bucket it into a severity band in one query.
SELECT cve.main.cvss_severity(cve.main.cvss_base_score('CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'));
19 more examples in the Catalog, each listed under the table or function it uses.
Questions it can answer
Plain-English questions from the worker's agent test tasks. An AI agent with this catalog attached should answer each one with SQL.
- What qualitative CVSS severity band corresponds to a base score of 5.0? Return one row with a single VARCHAR column holding the band name.
- Look up the CVE record for CVE-2021-44228 (Log4Shell) and report its CVSS base score and qualitative severity.
- Keyword-search the NVD for CVEs mentioning log4j and confirm the Log4Shell advisory CVE-2021-44228 is among the matches.
- List the CVEs that affect the product cpe:2.3:a:apache:log4j:2.14.1:*:*:*:*:*:*:* and confirm Log4Shell (CVE-2021-44228) is one of them.
- What is the current EPSS exploitation probability and percentile for CVE-2021-44228?
- Which OSV.dev advisories affect the PyPI package jinja2 at version 2.4.1? List each advisory id with its CVE ids and the versions that fix it.
CVE is an independent open-source connector from Query.Farm. It is not affiliated with, endorsed by or sponsored by the services, projects or organisations it works with. Product names, logos and trademarks belong to their respective owners.
Related workers
Indicators of compromise
Security & forensics
Pull indicators of compromise out of threat reports and defang or refang them safely
Registry hives
Security & forensics
Parse offline Windows Registry hive files into SQL rows for forensics, with transaction-log replay and deleted-key recovery
Secret scanning
Security & forensics
Find leaked API keys, tokens and private keys in text from SQL, offline and with redacted output