@@ -329,9 +329,21 @@ scan_github_advisories() {
329329 local repo_owner=" microsoft"
330330 local repo_name=" vscode"
331331 local vscode_version=$( jq -r ' .version' third-party-src/package.json)
332+ local backported_file=" patches/backported-patches.json"
332333
333334 echo " Found VS Code version: $vscode_version "
334335
336+ # Load backported patches list if exists
337+ local -A backported_patches
338+ if [ -f " $backported_file " ]; then
339+ echo " Loading backported patches from $backported_file "
340+ local finding_ids=$( jq -r ' .[].finding_id' " $backported_file " )
341+ while IFS= read -r finding_id; do
342+ [ -n " $finding_id " ] && backported_patches[" $finding_id " ]=1
343+ done <<< " $finding_ids"
344+ echo " Loaded ${# backported_patches[@]} backported patches to ignore"
345+ fi
346+
335347 echo " Fetching security advisories from GitHub API for $repo_owner /$repo_name "
336348
337349 # Fetch security advisories using GitHub CLI
@@ -426,6 +438,13 @@ scan_github_advisories() {
426438 is_version_affected=true
427439 fi
428440
441+ # Check if this advisory is in the backported patches list
442+ if [[ -v backported_patches[" $ghsa_id " ] ]] || [[ " $cve_id " != " N/A" && -v backported_patches[" $cve_id " ] ]]; then
443+ echo " ℹ️ Ignoring - patch backported to current version"
444+ advisory_index=$(( advisory_index + 1 ))
445+ continue
446+ fi
447+
429448 # Count concerning advisories based on combined criteria
430449 # Advisory is concerning if BOTH conditions are met:
431450 # 1. Version is affected AND 2. Severity is medium/high/critical
0 commit comments