Skip to content

SecurityFinding

All Kovar check functions return arrays of SecurityFinding objects. This page documents the core types.

interface SecurityFinding {
id: string; // e.g. "header-missing-hsts", "csrf-unprotected-endpoint"
category: FindingCategory; // see FindingCategory below
severity: "critical" | "high" | "medium" | "low" | "info";
message: string; // human-readable description
remediation: string; // how to fix
url?: string; // for endpoint-level findings
header?: string; // for header findings
cookie?: string; // for cookie findings
payload?: string; // for XSS findings
evidence?: string; // for XSS findings
cweId?: string; // e.g. "CWE-352", "CWE-942"
cvssScore?: number; // CVSS v3.1 base score (0-10)
cvssVector?: string; // CVSS v3.1 vector string
references?: string[]; // links to relevant standards or docs
}
FieldTypeDescription
idstringUnique finding identifier (e.g. "header-missing-hsts")
categoryFindingCategoryFinding category (see below)
severitystringOne of: "critical", "high", "medium", "low", "info"
messagestringHuman-readable description of the issue
remediationstringHow to fix the issue
urlstring?Affected URL (for endpoint-level findings)
headerstring?Affected header name (for header findings)
cookiestring?Affected cookie name (for cookie findings)
payloadstring?XSS payload that triggered the finding
evidencestring?Evidence of XSS reflection
cweIdstring?CWE identifier (e.g. "CWE-352")
cvssScorenumber?CVSS v3.1 base score (0-10)
cvssVectorstring?CVSS v3.1 vector string
referencesstring[]?Links to relevant standards or documentation
type FindingCategory =
| "headers"
| "cookies"
| "xss"
| "authentication"
| "access-control"
| "injection"
| "cryptography"
| "configuration"
| "secrets"
| "information-disclosure";

Severity levels from most to least severe:

LevelDescriptionScore Impact
criticalImmediate risk, must fix before deployment-20
highSerious risk, fix soon-10
mediumModerate risk, should fix-5
lowMinor risk, fix when convenient-2
infoInformational, no direct risk0

Returned by security.audit():

interface SecurityReport {
url: string; // URL that was audited
timestamp: string; // ISO 8601 timestamp
duration: number; // Audit duration in milliseconds
findings: SecurityFinding[]; // All findings
summary: {
total: number;
critical: number;
high: number;
medium: number;
low: number;
info: number;
};
}