@hrbrmstr/euvd
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

@hrbrmstr/euvd

TypeScript client for the European Union Vulnerability Database (EUVD) API.

Installation

npm install @hrbrmstr/euvd

or

yarn add @hrbrmstr/euvd

Usage

Basic Usage

import { EUVDClient } from '@hrbrmstr/euvd';

// Create a client with default options
const client = new EUVDClient();

// Get the latest vulnerabilities
async function getLatest() {
  try {
    const vulns = await client.getLatestVulnerabilities();
    console.log(vulns);
  } catch (error) {
    console.error('Error fetching latest vulnerabilities:', error);
  }
}

getLatest();

Custom Configuration

import { EUVDClient } from '@hrbrmstr/euvd';

// Create a client with custom options
const client = new EUVDClient({
  baseUrl: 'https://euvdservices.enisa.europa.eu', // This is the default
  timeout: 60000, // 60 seconds
  axiosConfig: {
    headers: {
      'User-Agent': 'My-EUVD-Client/1.0'
    }
  }
});

Query Vulnerabilities with Filters

import { EUVDClient } from '@hrbrmstr/euvd';

const client = new EUVDClient();

async function queryVulns() {
  try {
    // Find high severity vulnerabilities that are being exploited
    const result = await client.queryVulnerabilities({
      fromScore: 8,
      toScore: 10,
      exploited: true,
      size: 100,
      page: 0
    });
    
    console.log(`Found ${result.total} vulnerabilities`);
    console.log(result.items);
  } catch (error) {
    console.error('Error querying vulnerabilities:', error);
  }
}

queryVulns();

Get Specific Vulnerability by ID

import { EUVDClient } from '@hrbrmstr/euvd';

const client = new EUVDClient();

async function getVulnById() {
  try {
    // Get details for a CVE
    const vuln = await client.getVulnerabilityById('CVE-2025-24054');
    console.log(vuln);
    
    // Get details for a EUVD ID
    const euvdEntry = await client.getEUVDById('EUVD-2025-4893');
    console.log(euvdEntry);
  } catch (error) {
    console.error('Error fetching vulnerability:', error);
  }
}

getVulnById();

API Methods

The client provides the following methods:

  • getLatestVulnerabilities() - Get the latest vulnerabilities (max 8)
  • getLatestExploitedVulnerabilities() - Get the latest exploited vulnerabilities (max 8)
  • getLatestCriticalVulnerabilities() - Get the latest critical vulnerabilities (max 8)
  • queryVulnerabilities(params) - Query vulnerabilities with various filters (max 100 per request)
  • getEUVDById(id) - Get detailed information about a specific EUVD entry
  • getVulnerabilityById(id) - Get detailed information about a vulnerability by ID (e.g., CVE)
  • getAdvisoryById(id) - Get detailed information about an advisory by ID

Query Parameters

When using queryVulnerabilities(), you can provide the following parameters:

  • fromScore (0-10, e.g., fromScore=7.5)
  • toScore (0-10, e.g., toScore=10)
  • fromEpss (0-100, e.g., fromEpss=20)
  • toEpss (0-100, e.g., toEpss=90)
  • fromDate (YYYY-MM-DD, e.g., fromDate=2023-01-14)
  • toDate (YYYY-MM-DD, e.g., toDate=2025-01-14)
  • product (string, e.g., product=Windows)
  • vendor (string, e.g., vendor=Microsoft)
  • assigner (string, e.g., assigner=mitre)
  • exploited (true/false, e.g., exploited=true)
  • page (integer, starts at 0, e.g., page=2)
  • text (keywords, e.g., text=vulnerability)
  • size (integer, default 10, max 100, e.g., size=100)

License

MIT

Package Sidebar

Install

npm i @hrbrmstr/euvd

Weekly Downloads

25

Version

0.1.2

License

MIT

Unpacked Size

15.9 kB

Total Files

9

Last publish

Collaborators

  • hrbrmstr