Skip to content

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
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;
Result
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.

setup.sql
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;

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'
);

3. Run a query

query.sql
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;
More example queries β†’
Technical details
Verified connector release
v0.6.0
Engine
2.0.1
VGI protocol
3.4.0
Verified on
December 1, 2026
Release notes on GitHub
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]'
);

Overview

Look up and prioritize CVEs: NVD records, CISA KEV, FIRST EPSS, OSV.dev, and offline CVSS scoring

Catalog

Everything cve exposes once attached β€” read straight from the worker's released build.

cve 1 schema
main 1 table Β· 10 functions

CVE lookup (NVD, CISA KEV, FIRST EPSS, OSV.dev) and CVSS v3.1 scoring functions.

Schema examples (14)
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;
Result
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;
Tables
cvss_severity_bands 3 examples3 cols

The five CVSS v3.1 qualitative severity bands and the base-score range each covers.

Columns
severity VARCHAR
Qualitative CVSS v3.1 band: NONE, LOW, MEDIUM, HIGH, or CRITICAL.
min_scorenot null DOUBLE
Inclusive lower bound, on the 0.0-10.0 CVSS base-score scale, of the range mapped to this band.
max_scorenot null DOUBLE
Inclusive upper bound, on the 0.0-10.0 CVSS base-score scale, of the range mapped to this band.
ConstraintsPRIMARY KEY (severity)
Examples (3)

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;
Result
severity assets asset_list
NONE 0 NULL
LOW 1 kiosk-01
MEDIUM 0 NULL
HIGH 1 db-01
CRITICAL 2 app-02, web-01
Link
Scalar functions
cvss_base_score (vector VARCHAR) 1 example

Compute the CVSS v3.1 base score from a vector string

Arguments
vector VARCHAR
CVSS v3.1 vector string
ReturnsDOUBLE
Example

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');
Link
cvss_severity (score DOUBLE) 1 example

Map a CVSS base score (0.0-10.0) to NONE/LOW/MEDIUM/HIGH/CRITICAL

Arguments
score DOUBLE
CVSS base score
ReturnsVARCHAR
Example

Map a numeric CVSS base score to its qualitative band (returns 'CRITICAL').

SELECT cve.main.cvss_severity(9.8);
Link
Table functions
cpe_cves (cpe VARCHAR, base_url := VARCHAR, api_key := VARCHAR) 1 example

List CVEs affecting a CPE name from the NVD 2.0 API (paginated, bounded)

Positional arguments
cpe VARCHAR
CPE 2.3 name (e.g. cpe:2.3:a:apache:log4j:2.14.1:*:*:*:*:*:*:*)
Named arguments
base_url := VARCHAR
Override the NVD API base URL Β· default ""
api_key := VARCHAR
NVD API key (raises the rate limit) Β· default ""
Returns columns
cve_id VARCHAR
The CVE identifier affecting the CPE.
description VARCHAR
English description of the vulnerability.
cvss_score DOUBLE
CVSS base score (0.0-10.0); NULL when the CVE has no metrics yet.
cvss_severity VARCHAR
Qualitative band: NONE, LOW, MEDIUM, HIGH, or CRITICAL; NULL when the CVE has no metrics yet.
published VARCHAR
Publication timestamp (ISO 8601).
Example

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;
Link
cve (cveid VARCHAR, base_url := VARCHAR, api_key := VARCHAR) 2 examples

Fetch a single CVE record by ID from the NVD 2.0 API

Positional arguments
cveid VARCHAR
CVE identifier (e.g. CVE-2021-44228)
Named arguments
base_url := VARCHAR
Override the NVD API base URL Β· default ""
api_key := VARCHAR
NVD API key (raises the rate limit) Β· default ""
Returns columns
id VARCHAR
The CVE identifier, e.g. CVE-2021-44228.
description VARCHAR
English description of the vulnerability.
cvss_score DOUBLE
CVSS base score (0.0-10.0); NULL when the CVE has no metrics yet.
cvss_severity VARCHAR
Qualitative band: NONE, LOW, MEDIUM, HIGH, or CRITICAL; NULL when the CVE has no metrics yet.
cvss_vector VARCHAR
The CVSS vector string NVD scored (v3.1 preferred, else v3.0, else v2); NULL when the CVE has no metrics yet. cvss_base_score accepts only the v3.x forms.
published VARCHAR
Publication timestamp (ISO 8601).
last_modified VARCHAR
Last-modified timestamp (ISO 8601).
cwe VARCHAR
Associated CWE identifier(s).
Examples (2)

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;
Link
epss (cvei_ds VARCHAR[], date := VARCHAR, base_url := VARCHAR) 3 examples

Score CVEs with FIRST EPSS (probability of exploitation in the next 30 days)

Positional arguments
cvei_ds VARCHAR[]
List of CVE identifiers to score (e.g. ['CVE-2021-44228'])
Named arguments
date := VARCHAR
Historical score date as YYYY-MM-DD (default: latest) Β· default ""
base_url := VARCHAR
Override the FIRST EPSS API endpoint URL Β· default ""
Returns columns
cve_id VARCHAR
The scored CVE identifier.
epss DOUBLE
EPSS probability (0.0-1.0) that the CVE is exploited in the next 30 days.
percentile DOUBLE
Percentile rank (0.0-1.0) of this score among all EPSS-scored CVEs.
date DATE
The date the EPSS score was published for.
Examples (3)

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;
Link
kev (base_url := VARCHAR) 3 examples

List the CISA Known Exploited Vulnerabilities (KEV) catalog

Named arguments
base_url := VARCHAR
Override the CISA KEV JSON feed URL (the whole URL) Β· default ""
Returns columns
cve_id VARCHAR
The CVE identifier CISA lists as known exploited, e.g. CVE-2021-44228.
vendor_project VARCHAR
Vendor or project that owns the affected product, e.g. Apache.
product VARCHAR
Affected product name, e.g. Log4j2.
vulnerability_name VARCHAR
CISA's short title for the vulnerability.
date_added DATE
Date CISA added the CVE to the KEV catalog.
short_description VARCHAR
CISA's one-paragraph description of the vulnerability.
required_action VARCHAR
The remediation action CISA requires of US federal agencies.
due_date DATE
Remediation due date for US federal agencies under BOD 22-01.
known_ransomware_campaign_use VARCHAR
'Known' when CISA knows of ransomware campaigns using the CVE, else 'Unknown'.
notes VARCHAR
Free-text notes and reference URLs; NULL when CISA gave none.
cwes VARCHAR[]
CWE identifiers CISA associates with the CVE (possibly empty).
Examples (3)

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;
Link
kev_cve (cveid VARCHAR, base_url := VARCHAR) 2 examples

Look up one CVE in the CISA KEV catalog (one row if listed, else none)

Positional arguments
cveid VARCHAR
CVE identifier to check against the KEV catalog (e.g. CVE-2021-44228)
Named arguments
base_url := VARCHAR
Override the CISA KEV JSON feed URL (the whole URL) Β· default ""
Returns columns
cve_id VARCHAR
The CVE identifier CISA lists as known exploited, e.g. CVE-2021-44228.
vendor_project VARCHAR
Vendor or project that owns the affected product, e.g. Apache.
product VARCHAR
Affected product name, e.g. Log4j2.
vulnerability_name VARCHAR
CISA's short title for the vulnerability.
date_added DATE
Date CISA added the CVE to the KEV catalog.
short_description VARCHAR
CISA's one-paragraph description of the vulnerability.
required_action VARCHAR
The remediation action CISA requires of US federal agencies.
due_date DATE
Remediation due date for US federal agencies under BOD 22-01.
known_ransomware_campaign_use VARCHAR
'Known' when CISA knows of ransomware campaigns using the CVE, else 'Unknown'.
notes VARCHAR
Free-text notes and reference URLs; NULL when CISA gave none.
cwes VARCHAR[]
CWE identifiers CISA associates with the CVE (possibly empty).
Examples (2)

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');
Link
osv_query (ecosystem VARCHAR, name VARCHAR, version := VARCHAR, base_url := VARCHAR) 2 examples

List OSV.dev vulnerabilities affecting an open-source package (optionally one version)

Positional arguments
ecosystem VARCHAR
OSV ecosystem name (e.g. PyPI / npm / Maven / Go / crates.io / RubyGems / NuGet / Packagist)
name VARCHAR
Package name as the ecosystem spells it (e.g. jinja2 or org.apache.logging.log4j:log4j-core)
Named arguments
version := VARCHAR
Package version to check; empty returns every known vulnerability of the package Β· default ""
base_url := VARCHAR
Override the OSV.dev API root URL (default https://api.osv.dev/v1) Β· default ""
Returns columns
id VARCHAR
OSV identifier of the record, e.g. GHSA-jfh8-c2jp-5v3q, PYSEC-2019-217, or CVE-2021-44228.
summary VARCHAR
One-line summary; NULL when the source database gives none.
details VARCHAR
Full Markdown description; NULL when the source database gives none.
aliases VARCHAR[]
Other identifiers for the same vulnerability (CVE, GHSA, PYSEC, ...).
cve_ids VARCHAR[]
The CVE identifiers among id and aliases β€” join these to cve()/kev()/epss().
cvss_vector VARCHAR
CVSS vector string (v3.x preferred so cvss_base_score can score it, else v4, else v2); NULL when unscored.
database_severity VARCHAR
Source database's qualitative severity (e.g. GHSA's LOW/MODERATE/HIGH/CRITICAL); NULL when absent.
published VARCHAR
Publication timestamp (RFC 3339).
modified VARCHAR
Last-modified timestamp (RFC 3339).
withdrawn VARCHAR
Withdrawal timestamp (RFC 3339) when the advisory was retracted; NULL otherwise.
affected_packages VARCHAR[]
Affected packages as 'ecosystem:name' strings, e.g. 'PyPI:jinja2'.
affected_ranges VARCHAR[]
Affected version intervals for the queried package, e.g. '>=2.13.0 <2.15.0' or '<2.10.1' (git commit ranges omitted).
fixed_versions VARCHAR[]
Versions that fix the vulnerability for the queried package.
Examples (2)

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;
Link
osv_vuln (id VARCHAR, base_url := VARCHAR) 2 examples

Fetch one OSV.dev vulnerability record by id (GHSA-, PYSEC-, CVE-, GO-, RUSTSEC- ...)

Positional arguments
id VARCHAR
OSV vulnerability id (e.g. GHSA-jfh8-c2jp-5v3q / PYSEC-2019-217 / CVE-2021-44228)
Named arguments
base_url := VARCHAR
Override the OSV.dev API root URL (default https://api.osv.dev/v1) Β· default ""
Returns columns
id VARCHAR
OSV identifier of the record, e.g. GHSA-jfh8-c2jp-5v3q, PYSEC-2019-217, or CVE-2021-44228.
summary VARCHAR
One-line summary; NULL when the source database gives none.
details VARCHAR
Full Markdown description; NULL when the source database gives none.
aliases VARCHAR[]
Other identifiers for the same vulnerability (CVE, GHSA, PYSEC, ...).
cve_ids VARCHAR[]
The CVE identifiers among id and aliases β€” join these to cve()/kev()/epss().
cvss_vector VARCHAR
CVSS vector string (v3.x preferred so cvss_base_score can score it, else v4, else v2); NULL when unscored.
database_severity VARCHAR
Source database's qualitative severity (e.g. GHSA's LOW/MODERATE/HIGH/CRITICAL); NULL when absent.
published VARCHAR
Publication timestamp (RFC 3339).
modified VARCHAR
Last-modified timestamp (RFC 3339).
withdrawn VARCHAR
Withdrawal timestamp (RFC 3339) when the advisory was retracted; NULL otherwise.
affected_packages VARCHAR[]
Affected packages as 'ecosystem:name' strings, e.g. 'PyPI:jinja2'.
affected_ranges VARCHAR[]
Affected version intervals across all affected packages, e.g. '>=2.13.0 <2.15.0' or '<2.10.1' (git commit ranges omitted).
fixed_versions VARCHAR[]
Versions that fix the vulnerability across all affected packages.
Examples (2)

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');
Link

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

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'));

Uses cvss_severitycvss_base_score

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.