From 2f91097e56b765af8140e5854c1818125d581474 Mon Sep 17 00:00:00 2001 From: Mark Gregory Date: Thu, 22 Oct 2026 18:24:44 +0100 Subject: [PATCH] Updates to scanner with CVE saving and auto update --- PHPGuard/VulnerabilityService.swift | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/PHPGuard/VulnerabilityService.swift b/PHPGuard/VulnerabilityService.swift index 3a0f4f3..7a143ab 100644 --- a/PHPGuard/VulnerabilityService.swift +++ b/PHPGuard/VulnerabilityService.swift @@ -397,9 +397,28 @@ extension VulnerabilityService { return assessments.map { original in var item = original item.vendorStatus = "Unverified" - item.vendorEvidence = - "Ubuntu archive provenance not established for installed PHP packages. " + - "Third-party or custom builds require independent verification." + let ubuntuMatches = report.packageOrigins.filter { + $0.hasPrefix("UBUNTU_REPOSITORY_MATCH|") + } + + let otherMatches = report.packageOrigins.filter { + $0.hasPrefix("OTHER_REPOSITORY_MATCH|") + } + + if !ubuntuMatches.isEmpty && otherMatches.isEmpty { + item.vendorEvidence = + "Installed PHP package versions match official Ubuntu repository entries. " + + "Installed binary provenance has not been independently verified; " + + "vendor CVE status remains Unverified." + } else if !otherMatches.isEmpty { + item.vendorEvidence = + "One or more PHP package versions match third-party repositories. " + + "Ubuntu vendor CVE status remains Unverified." + } else { + item.vendorEvidence = + "Ubuntu archive provenance not established for installed PHP packages. " + + "No confirmed Ubuntu repository matches were collected." + } return item } }