Skip to main content

Vulnerabilities

List Vulnerabilities

Get a paginated list of vulnerabilities with optional filtering by workspace, severity, confidence, or asset value. List all vulnerabilities:
curl http://localhost:8002/osm/api/vulnerabilities \
  -H "Authorization: Bearer $TOKEN"
List vulnerabilities with pagination:
curl "http://localhost:8002/osm/api/vulnerabilities?offset=0&limit=100" \
  -H "Authorization: Bearer $TOKEN"
Filter by workspace:
curl "http://localhost:8002/osm/api/vulnerabilities?workspace=example.com" \
  -H "Authorization: Bearer $TOKEN"
Filter by severity:
curl "http://localhost:8002/osm/api/vulnerabilities?severity=critical" \
  -H "Authorization: Bearer $TOKEN"
Filter by confidence:
curl "http://localhost:8002/osm/api/vulnerabilities?confidence=Certain" \
  -H "Authorization: Bearer $TOKEN"
Filter by asset value (partial match):
curl "http://localhost:8002/osm/api/vulnerabilities?asset_value=api.example" \
  -H "Authorization: Bearer $TOKEN"
Combine filters:
curl "http://localhost:8002/osm/api/vulnerabilities?workspace=example.com&severity=high&offset=0&limit=50" \
  -H "Authorization: Bearer $TOKEN"
Query Parameters:
ParameterTypeDefaultDescription
workspacestring-Filter by workspace name
severitystring-Filter by severity (critical, high, medium, low, info)
confidencestring-Filter by confidence (Certain, Firm, Tentative, Manual Review Required)
asset_valuestring-Filter by asset value (partial match)
offsetint0Number of records to skip
limitint20Maximum records to return (max 10000)
Response:
{
  "data": [
    {
      "id": 1,
      "workspace": "example.com",
      "vuln_info": "CVE-2024-1234",
      "vuln_title": "SQL Injection in Login Form",
      "vuln_desc": "The login form is vulnerable to SQL injection via the username parameter.",
      "vuln_poc": "username=' OR '1'='1' --&password=test",
      "severity": "critical",
      "confidence": "Certain",
      "asset_type": "web",
      "asset_value": "https://example.com/login",
      "tags": ["sqli", "owasp-top10", "authentication"],
      "detail_http_request": "POST /login HTTP/1.1\nHost: example.com\n...",
      "detail_http_response": "HTTP/1.1 200 OK\n...",
      "raw_vuln_json": "{\"template\":\"sqli-login.yaml\",...}",
      "created_at": "2025-01-15T10:30:00Z",
      "updated_at": "2025-01-15T10:30:00Z"
    },
    {
      "id": 2,
      "workspace": "example.com",
      "vuln_info": "CVE-2024-5678",
      "vuln_title": "Cross-Site Scripting (XSS) in Search",
      "vuln_desc": "Reflected XSS vulnerability in the search functionality.",
      "vuln_poc": "<script>alert('XSS')</script>",
      "severity": "high",
      "confidence": "Firm",
      "asset_type": "web",
      "asset_value": "https://example.com/search",
      "tags": ["xss", "owasp-top10"],
      "detail_http_request": "GET /search?q=<script>alert(1)</script> HTTP/1.1\n...",
      "detail_http_response": "HTTP/1.1 200 OK\n...",
      "raw_vuln_json": "{\"template\":\"xss-reflected.yaml\",...}",
      "created_at": "2025-01-15T10:31:00Z",
      "updated_at": "2025-01-15T10:31:00Z"
    }
  ],
  "pagination": {
    "total": 15,
    "offset": 0,
    "limit": 20
  }
}

Get Vulnerability Summary

Get a summary of vulnerabilities grouped by severity, optionally filtered by workspace. Get summary for all workspaces:
curl http://localhost:8002/osm/api/vulnerabilities/summary \
  -H "Authorization: Bearer $TOKEN"
Get summary for a specific workspace:
curl "http://localhost:8002/osm/api/vulnerabilities/summary?workspace=example.com" \
  -H "Authorization: Bearer $TOKEN"
Query Parameters:
ParameterTypeDefaultDescription
workspacestring-Filter by workspace name
Response:
{
  "data": {
    "by_severity": {
      "critical": 2,
      "high": 5,
      "medium": 8,
      "low": 12,
      "info": 3
    },
    "total": 30,
    "workspace": "example.com"
  }
}

Get Vulnerability by ID

Retrieve a single vulnerability by its ID.
curl http://localhost:8002/osm/api/vulnerabilities/1 \
  -H "Authorization: Bearer $TOKEN"
Response:
{
  "data": {
    "id": 1,
    "workspace": "example.com",
    "vuln_info": "CVE-2024-1234",
    "vuln_title": "SQL Injection in Login Form",
    "vuln_desc": "The login form is vulnerable to SQL injection via the username parameter.",
    "vuln_poc": "username=' OR '1'='1' --&password=test",
    "severity": "critical",
    "confidence": "Certain",
    "asset_type": "web",
    "asset_value": "https://example.com/login",
    "tags": ["sqli", "owasp-top10", "authentication"],
    "detail_http_request": "POST /login HTTP/1.1\nHost: example.com\n...",
    "detail_http_response": "HTTP/1.1 200 OK\n...",
    "raw_vuln_json": "{\"template\":\"sqli-login.yaml\",...}",
    "created_at": "2025-01-15T10:30:00Z",
    "updated_at": "2025-01-15T10:30:00Z"
  }
}
Error Response (404):
{
  "error": true,
  "message": "Vulnerability not found"
}

Create Vulnerability

Create a new vulnerability record.
curl -X POST http://localhost:8002/osm/api/vulnerabilities \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "workspace": "example.com",
    "vuln_info": "CVE-2024-9999",
    "vuln_title": "Remote Code Execution",
    "vuln_desc": "Critical RCE vulnerability in admin panel.",
    "vuln_poc": "curl -X POST /admin/exec -d \"cmd=id\"",
    "severity": "critical",
    "asset_type": "web",
    "asset_value": "https://example.com/admin",
    "tags": ["rce", "critical", "admin"],
    "detail_http_request": "POST /admin/exec HTTP/1.1\n...",
    "detail_http_response": "HTTP/1.1 200 OK\nuid=0(root)...",
    "raw_vuln_json": "{\"template\":\"rce-admin.yaml\"}"
  }'
Request Body:
FieldTypeRequiredDescription
workspacestringYesWorkspace/target name
vuln_infostringNoCVE or vulnerability identifier
vuln_titlestringNoShort title for the vulnerability
vuln_descstringNoDetailed description
vuln_pocstringNoProof of concept
severitystringNoSeverity level (critical, high, medium, low, info)
confidencestringNoConfidence level (Certain, Firm, Tentative, Manual Review Required)
asset_typestringNoType of asset (web, api, network, etc.)
asset_valuestringNoAffected asset URL or identifier
tagsarrayNoTags for categorization
detail_http_requeststringNoRaw HTTP request
detail_http_responsestringNoRaw HTTP response
raw_vuln_jsonstringNoRaw JSON from scanner (nuclei, etc.)
Response (201 Created):
{
  "data": {
    "id": 15,
    "workspace": "example.com",
    "vuln_info": "CVE-2024-9999",
    "vuln_title": "Remote Code Execution",
    "vuln_desc": "Critical RCE vulnerability in admin panel.",
    "vuln_poc": "curl -X POST /admin/exec -d \"cmd=id\"",
    "severity": "critical",
    "confidence": "Certain",
    "asset_type": "web",
    "asset_value": "https://example.com/admin",
    "tags": ["rce", "critical", "admin"],
    "detail_http_request": "POST /admin/exec HTTP/1.1\n...",
    "detail_http_response": "HTTP/1.1 200 OK\nuid=0(root)...",
    "raw_vuln_json": "{\"template\":\"rce-admin.yaml\"}",
    "created_at": "2025-01-15T14:25:00Z",
    "updated_at": "2025-01-15T14:25:00Z"
  },
  "message": "Vulnerability created successfully"
}
Error Response (400):
{
  "error": true,
  "message": "Workspace is required"
}

Delete Vulnerability

Delete a vulnerability by ID.
curl -X DELETE http://localhost:8002/osm/api/vulnerabilities/15 \
  -H "Authorization: Bearer $TOKEN"
Response:
{
  "message": "Vulnerability deleted successfully"
}
Error Response (404):
{
  "error": true,
  "message": "Vulnerability not found"
}

Vulnerability Fields Reference

FieldTypeDescription
idintUnique vulnerability identifier
workspacestringWorkspace/scan target name
vuln_infostringCVE or vulnerability identifier
vuln_titlestringShort descriptive title
vuln_descstringDetailed vulnerability description
vuln_pocstringProof of concept exploit
severitystringSeverity level (critical, high, medium, low, info)
confidencestringConfidence level (Certain, Firm, Tentative, Manual Review Required)
asset_typestringType of affected asset
asset_valuestringAffected asset URL or identifier
tagsarrayCategorization tags
detail_http_requeststringRaw HTTP request that triggered the vulnerability
detail_http_responsestringRaw HTTP response from the vulnerable endpoint
raw_vuln_jsonstringRaw JSON output from vulnerability scanner
created_attimestampRecord creation timestamp
updated_attimestampLast update timestamp