@php $_pdfLogo = null; foreach (['png','svg','jpg','jpeg'] as $_ext) { $_path = public_path('logo.'.$_ext); if (file_exists($_path)) { $_mime = $_ext === 'svg' ? 'image/svg+xml' : 'image/'.$_ext; $_pdfLogo = 'data:'.$_mime.';base64,'.base64_encode(file_get_contents($_path)); break; } } @endphp 弱點掃描報告 @php $bySev = $summary['by_severity'] ?? []; $byOwasp = $summary['by_owasp'] ?? []; $byLlmOwasp = $summary['by_llm_owasp'] ?? []; $exposedEndpoints = $summary['exposed_llm_endpoints'] ?? []; $total = $summary['total'] ?? 0; $isAiMode = ($vulnScan->scan_mode === 'ai'); $isGarakMode = ($vulnScan->scanner_type === 'garak'); $critical = $bySev['critical'] ?? 0; $high = $bySev['high'] ?? 0; $medium = $bySev['medium'] ?? 0; $low = $bySev['low'] ?? 0; $info = $bySev['info'] ?? 0; $pagesScanned = $summary['pages_scanned'] ?? null; // 整體風險等級判斷 if ($critical > 0) { $riskLevel = 'CRITICAL'; $riskClass = 'critical'; $riskDesc = "本次掃描發現 {$critical} 個嚴重等級(Critical)漏洞,系統面臨極高風險。攻擊者可能利用這些漏洞取得系統控制權、竊取敏感資料或造成服務中斷。建議立即停機處理或採取緊急緩解措施。"; } elseif ($high > 0) { $riskLevel = 'HIGH'; $riskClass = 'high'; $riskDesc = "本次掃描發現 {$high} 個高等級(High)漏洞,系統存在重大安全風險。若未及時修復,攻擊者可能造成資料洩漏或服務異常。建議於 7 天內完成修補。"; } elseif ($medium > 0) { $riskLevel = 'MEDIUM'; $riskClass = 'medium'; $riskDesc = "本次掃描發現 {$medium} 個中等等級(Medium)漏洞,系統存在一定安全風險。建議於 30 天內評估並完成修補,避免漏洞被惡意組合利用。"; } elseif ($low > 0) { $riskLevel = 'LOW'; $riskClass = 'low'; $riskDesc = "本次掃描結果顯示整體風險偏低,僅發現 {$low} 個低等級(Low)漏洞或設定問題。建議於例行維護週期中一併修復。"; } else { $riskLevel = 'INFO'; $riskClass = 'info'; $riskDesc = "本次掃描未發現明顯安全漏洞,所有發現皆為資訊性(Info)項目,主要為系統技術指紋識別。系統整體安全狀態良好,建議持續定期執行掃描。"; } $profileNames = [ 'pentest' => '綜合滲透測試(pentest)', 'misconfigurations'=> '安全設定錯誤偵測(misconfigurations)', 'cves' => 'CVE 已知漏洞比對(cves)', 'default-login' => '預設帳號密碼檢查(default-login)', 'recommended' => '建議掃描模式(recommended)', 'all' => '全量掃描(all)', 'wordpress' => 'WordPress 安全掃描(wordpress)', 'kev' => 'CISA KEV 高危漏洞(kev)', 'owasp-web' => 'OWASP Top 10 全涵蓋(owasp-web)', ]; $scannerType = $vulnScan->scanner_type ?? 'nuclei'; // 掃描工具顯示資訊(ZAP 版本從 scanner_version 欄位取得) $zapVer = $vulnScan->scanner_version ? 'v' . $vulnScan->scanner_version : 'Stable (Docker)'; $garakModel = $vulnScan->llm_model ?? ($summary['llm_model'] ?? ''); $scannerMeta = [ 'nuclei' => ['label' => 'Nuclei', 'ver' => 'v3.8.0', 'color' => '#4ade80'], 'zap' => ['label' => 'OWASP ZAP', 'ver' => $zapVer, 'color' => '#60a5fa'], 'nessus' => ['label' => 'Nessus', 'ver' => 'Essentials','color' => '#fbbf24'], 'garak' => ['label' => 'Garak', 'ver' => 'latest', 'color' => '#34d399'], ][$scannerType] ?? ['label' => $scannerType, 'ver' => '', 'color' => '#9ca3af']; // 掃描模式名稱 if ($scannerType === 'nuclei') { $profileName = $profileNames[$vulnScan->profile] ?? $vulnScan->profile; } else { $modeLabels = [ 'baseline' => 'ZAP Baseline(快速被動掃描)', 'full' => 'ZAP Full Scan(完整主動掃描)', 'api' => 'ZAP API Scan', 'ai' => 'ZAP AI / LLM 伺服器掃描(OWASP LLM Top 10)', 'basic' => 'Nessus Basic Network Scan', 'webapp' => 'Nessus Web Application Tests', 'advanced' => 'Nessus Advanced Scan', 'quick' => 'Garak 快速掃描(injection + leakage)', 'standard' => 'Garak 標準掃描(injection + leakage + jailbreak + continuation)', 'comprehensive' => 'Garak 完整掃描(全探針)', ]; $profileName = $modeLabels[$vulnScan->scan_mode ?? ''] ?? ($vulnScan->scan_mode ?? '—'); } $sec = $vulnScan->durationSeconds(); $duration = $sec ? ($sec >= 60 ? floor($sec/60).'m '.($sec%60).'s' : $sec.'s') : '—'; // OWASP Top 10 2021 詳細說明 $owaspDetail = [ 'A01:2021' => ['name'=>'存取控制失效', 'desc'=>'使用者被允許執行超出其預期權限的操作,可能導致未授權的資料讀取、修改或刪除。'], 'A02:2021' => ['name'=>'加密機制失效', 'desc'=>'與加密相關的失敗,通常導致敏感資料暴露。包括明文傳輸、弱加密演算法、不安全的金鑰管理。'], 'A03:2021' => ['name'=>'注入式攻擊', 'desc'=>'攻擊者向直譯器發送惡意資料,如 SQL、OS 命令、XSS。可能導致資料竊取、損毀或系統入侵。'], 'A04:2021' => ['name'=>'不安全設計', 'desc'=>'設計階段缺乏安全考量,包括缺乏威脅建模、不安全的設計模式、無法防禦業務邏輯攻擊。'], 'A05:2021' => ['name'=>'安全設定錯誤', 'desc'=>'不安全的預設設定、不完整設定、開放式雲端存儲、錯誤的 HTTP 標頭、詳細錯誤訊息等。'], 'A06:2021' => ['name'=>'易受攻擊與過時的元件', 'desc'=>'使用有已知漏洞的函式庫、框架或軟體模組,可能破壞應用程式防禦,導致嚴重影響。'], 'A07:2021' => ['name'=>'身分驗證失效', 'desc'=>'與身分驗證和工作階段管理相關的弱點,允許攻擊者入侵密碼、金鑰或工作階段令牌。'], 'A08:2021' => ['name'=>'軟體及資料完整性失效', 'desc'=>'未驗證完整性的軟體更新、關鍵資料及 CI/CD 管道,如不安全的反序列化漏洞。'], 'A09:2021' => ['name'=>'安全記錄及監控失效', 'desc'=>'缺乏足夠的記錄和監控,導致無法偵測攻擊,使攻擊者能長期潛伏系統中。'], 'A10:2021' => ['name'=>'伺服器端請求偽造', 'desc'=>'應用程式在未驗證使用者提供 URL 的情況下發送請求,攻擊者可存取內部服務。'], ]; // ZAP 常見 plugin 說明與修復建議 $zapPlugins = [ '10003' => ['desc'=>'偵測到已知存在安全漏洞的 JavaScript 函式庫版本,攻擊者可利用已公開漏洞攻擊使用者瀏覽器。', 'sol'=>'更新至最新穩定版本的 JS 函式庫,定期使用 Snyk 或 npm audit 檢查元件安全性。'], '10010' => ['desc'=>'Cookie 未設定 HttpOnly 旗標,JavaScript 可讀取 Cookie 值,增加 XSS 竊取 Session 的風險。', 'sol'=>'為所有敏感 Cookie(特別是 Session Cookie)設定 HttpOnly 屬性。'], '10011' => ['desc'=>'Cookie 未設定 Secure 旗標,可能透過非加密的 HTTP 連線傳送敏感 Cookie。', 'sol'=>'為所有 Cookie 設定 Secure 屬性,確保只透過 HTTPS 傳送。'], '10015' => ['desc'=>'應用程式在回應中揭露伺服器版本、框架等技術資訊,可協助攻擊者定位已知漏洞。', 'sol'=>'移除或模糊化回應標頭中的版本資訊,設定適當的錯誤處理頁面。'], '10020' => ['desc'=>'缺少 X-Frame-Options 或 CSP frame-ancestors 標頭,網站可能被嵌入 iframe,導致 Clickjacking。','sol'=>'設定 X-Frame-Options: DENY 或 SAMEORIGIN,或使用 CSP frame-ancestors 指令。'], '10021' => ['desc'=>'回應缺少 X-Content-Type-Options: nosniff,允許瀏覽器進行 MIME 嗅探,可能導致安全問題。', 'sol'=>'在所有回應中設定 X-Content-Type-Options: nosniff 標頭。'], '10038' => ['desc'=>'Content Security Policy (CSP) 標頭遺失或設定不當,可能允許惡意腳本在網頁中執行。', 'sol'=>'實作嚴格的 CSP 標頭,限制可載入腳本、樣式和其他資源的來源。'], '10040' => ['desc'=>'偵測到跨站腳本(XSS)漏洞,攻擊者可注入惡意腳本執行於使用者瀏覽器。', 'sol'=>'對所有使用者輸入進行嚴格的輸入驗證和輸出編碼,實作 Content Security Policy。'], '10055' => ['desc'=>'缺少 Content Security Policy 標頭,網站易受跨站腳本等注入類攻擊。', 'sol'=>'部署強健的 Content Security Policy,定義允許的資源來源。'], '10098' => ['desc'=>'CORS 設定不當,可能允許未授權的跨源請求存取敏感資料。', 'sol'=>'嚴格設定 CORS 政策,只允許可信任的來源,避免使用萬用字元 *。'], '10108' => ['desc'=>'缺少 Referrer-Policy 標頭,可能洩漏使用者瀏覽的 URL 資訊給第三方。', 'sol'=>'設定 Referrer-Policy: strict-origin-when-cross-origin 標頭。'], '10109' => ['desc'=>'Permissions-Policy 標頭遺失,瀏覽器功能(如攝像頭、麥克風)沒有明確限制。', 'sol'=>'設定 Permissions-Policy 標頭,明確限制或禁用不需要的瀏覽器功能。'], '90004' => ['desc'=>'Cross-Origin-Embedder-Policy (COEP) 標頭遺失或無效,降低旁信道攻擊(如 Spectre)的防護能力。', 'sol'=>'設定 Cross-Origin-Embedder-Policy: require-corp 標頭,強制跨來源資源必須明確允許共享。'], '90011' => ['desc'=>'HTTP 回應標頭與 HTML meta 標籤的字元集不一致,可能導致字元集混淆攻擊。', 'sol'=>'確保 Content-Type 標頭和 HTML meta charset 統一使用 UTF-8。'], '90022' => ['desc'=>'伺服器暴露了應用程式的技術指紋資訊,攻擊者可針對已知漏洞進行攻擊。', 'sol'=>'移除 X-Powered-By、Server 等暴露技術資訊的回應標頭。'], ]; @endphp {{-- ══════════════════════ 封面頁 ══════════════════════ --}}
{{-- 頂部深藍 Band:智新 LOGO ╱ Nuclei + CONFIDENTIAL --}}
@if($_pdfLogo) {{ config('app.company_name') }} @else @endif
@if(!$_pdfLogo)
{{ config('app.company_name') }}
@endif
資安檢測服務
CONFIDENTIAL
{{-- 掃描工具 LOGO:依 scanner_type 動態切換 --}}
@if($scannerType === 'zap') {{-- OWASP ZAP:藍色盾牌+蟲 --}} @elseif($scannerType === 'nessus') {{-- Nessus:橘色活動波形 --}} @else {{-- Nuclei:綠色六角形 --}} @endif
{{ $scannerMeta['label'] }}
{{ $scannerMeta['ver'] }}
{{-- 白底主體(flex column,footer 靠底)--}}
{{-- 主要內容區(flex:1 把 footer 推到底)--}}
Web Application Security Assessment
弱點掃描報告
Vulnerability Assessment Report

Prepared for  ·  委託單位
{{ $client?->name ?? '(未指定委託單位)' }}

Target Website  ·  掃描目標網站
{{ $vulnScan->target_url }}
Project  ·  所屬專案
{{ $project?->name ?? '—' }}
Scan Date  ·  掃描日期
{{ $vulnScan->started_at?->format('Y-m-d') ?? '—' }}
Scan Time  ·  掃描時間
{{ $vulnScan->started_at?->format('H:i') ?? '—' }} @if($vulnScan->finished_at) – {{ $vulnScan->finished_at->format('H:i') }} @endif
@if($duration !== '—')
歷時 {{ $duration }}
@endif

Report Date  ·  報告產生日期
{{ now()->format('Y 年 m 月 d 日') }}
掃描模式:{{ $profileName }}
Overall Risk Level  ·  整體風險等級
{{ $riskLevel }}
共 {{ $total }} 筆   C {{ $critical }} H {{ $high }} M {{ $medium }} L {{ $low }} I {{ $info }}
@if($pagesScanned !== null)
🌐 {{ number_format($pagesScanned) }} 個頁面/URL
@endif
{{-- end cv-body-content --}} {{-- Footer 靠底 --}}
{{-- end cv-body --}}
{{-- ══════════════════════ 正文頁 ══════════════════════ --}}
{{-- 1. 執行摘要 --}}
一、執行摘要
整體風險等級:{{ $riskLevel }}
{{ $riskDesc }}

本次使用 {{ $scannerMeta['label'] }} {{ $scannerMeta['ver'] }} 弱點掃描引擎, 採用 {{ $profileName }} 模式, 針對目標 {{ $vulnScan->target_url }} 進行自動化安全檢測。 掃描作業於 {{ $vulnScan->started_at?->format('Y年m月d日 H:i') }} 開始, 歷時 {{ $duration }} 完成,涵蓋 OWASP Top 10 等主流弱點類型。 @if($pagesScanned !== null) 本次共掃描 {{ number_format($pagesScanned) }} 個頁面/URL。 @endif

{{-- 嚴重度統計 --}}
Critical High Medium Low Info
{{ $critical }}
CRITICAL
嚴重
{{ $high }}
HIGH
高風險
{{ $medium }}
MEDIUM
中風險
{{ $low }}
LOW
低風險
{{ $info }}
INFO
資訊
{{-- 2. 風險說明 --}}
二、風險等級說明
Critical 嚴重漏洞:可直接被遠端利用,無需授權即可取得系統控制權或存取敏感資料。常見如遠端程式碼執行(RCE)、SQL Injection(資料庫注入)等。 建議立即修復(24 小時內)。
High 高風險漏洞:可能造成重大損害,如資料洩漏、身分驗證繞過、未授權操作等。需要一定條件才能被利用。 建議 7 天內修復
Medium 中等風險:單獨利用危害有限,但可能與其他漏洞組合使用造成更大影響。常見如跨站腳本(XSS)、CSRF、資訊洩漏等。 建議 30 天內修復
Low 低風險:危害程度較低,通常為設定不當或資訊暴露問題。 建議於例行維護時修復
Info 資訊性:非直接安全威脅,主要為技術指紋識別、服務探測結果,可輔助了解系統暴露面。
{{-- 3. 主要發現摘要 --}} @php $nonInfo = array_filter($findings, fn($f) => ($f['severity'] ?? 'info') !== 'info'); $topFindings = array_slice(array_values($nonInfo) ?: $findings, 0, 10); @endphp
三、主要發現摘要(Top {{ count($topFindings) }})
@if(empty($topFindings))

本次掃描未發現高風險問題,所有發現均為資訊性項目。

@else @foreach($topFindings as $i => $f) @php $sev = $f['severity'] ?? 'info'; @endphp
{{ strtoupper($sev) }}  {{ $f['name'] ?: $f['template_id'] }} @if(!empty($f['matched_at']))  → {{ $f['matched_at'] }} @endif @if(!empty($f['description']))
{{ mb_strimwidth($f['description'], 0, 150, '…') }}
@endif
@endforeach @endif
{{-- 4. OWASP Top 10 分佈 --}} @if(!empty($byOwasp))
四、OWASP Top 10 風險分佈

OWASP(Open Web Application Security Project)Top 10 是國際公認的 Web 應用程式十大安全風險清單, 以下為本次掃描結果與 OWASP 分類的對應關係。

@foreach($owaspLabels as $oid => $olabel) @php $cnt = $byOwasp[$oid] ?? 0; @endphp @endforeach
分類 ID 風險名稱 發現數 狀態
{{ $oid }} {{ $olabel }} {{ $cnt > 0 ? $cnt : '—' }} @if($cnt > 0) ⚠ 發現 @else ✓ 未發現 @endif
@endif {{-- 4b. Garak LLM 行為安全評估(Garak 掃描) --}} @if($isGarakMode)
四、Garak LLM 行為安全評估

本次使用 Garak(NVIDIA 開源 LLM 安全評估工具)對目標模型 {{ $garakModel }} 進行 OWASP LLM Top 10 2025 行為安全測試。 Garak 直接對模型發送對抗性提示,評估提示注入、越獄攻擊、資料洩漏等風險。

ⓘ 結果說明: 每筆發現代表一個探針測試中模型產生了不符合安全預期的回應(測試失敗)。 「失敗率」越高代表模型對該類型攻擊越脆弱。 失敗率 ≥50% 標記為高風險,≥20% 為中風險。
@php $garakLlmOwasp = $summary['by_llm_owasp'] ?? []; $garakLlmRows = [ 'LLM01:2025' => ['提示注入', 'Prompt Injection', 'LLM01'], 'LLM02:2025' => ['敏感資訊洩漏', 'Sensitive Information Disclosure','LLM02'], 'LLM05:2025' => ['不當輸出處理', 'Improper Output Handling', 'LLM05'], 'LLM06:2025' => ['過度自主行為', 'Excessive Agency', 'LLM06'], 'LLM07:2025' => ['系統提示詞洩漏', 'System Prompt Leakage', 'LLM07'], 'LLM09:2025' => ['錯誤資訊', 'Misinformation', 'LLM09'], ]; @endphp @foreach($garakLlmRows as $lid => [$lname, $len, $short]) @php $lcnt = $garakLlmOwasp[$lid] ?? 0; @endphp @endforeach
分類 ID 風險名稱 失敗測試數 狀態
{{ $lid }}
{{ $lname }}
{{ $len }}
{{ $lcnt > 0 ? $lcnt : '—' }} @if($lcnt > 0) ⚠ 發現弱點 @else ✓ 通過測試 @endif
@endif {{-- isGarakMode --}} {{-- 4c. OWASP LLM Top 10(ZAP AI 掃描模式) --}} @if($isAiMode && !$isGarakMode)
{{ empty($byOwasp) ? '四' : '五' }}、OWASP LLM Top 10 2025 分析

OWASP LLM Top 10 2025 是 OWASP Foundation 針對大型語言模型(LLM)應用程式發布的十大安全風險框架, 以下為本次 AI 伺服器掃描結果與 LLM 風險分類的對應分析。

ⓘ 計數說明: 本表將 ZAP 偵測到的傳統 Web 漏洞對應至 OWASP LLM Top 10 類別。 同一筆漏洞可能對應多個類別,因此各類別數字加總會大於實際漏洞總數,此為正常現象。 顯示「—」代表未發現直接對應該類別的漏洞,並非代表該 LLM 風險不存在; 提示注入、模型投毒等 LLM 原生風險需搭配人工紅隊演練才能完整評估。
{{-- 已暴露 LLM 端點 --}} @if(!empty($exposedEndpoints))
⚠ 偵測到未受保護的 LLM API 端點({{ count($exposedEndpoints) }} 個)
以下端點在未提供任何認證的情況下可直接存取,攻擊者可能直接呼叫 AI 模型或執行管理操作:
@foreach($exposedEndpoints as $ep)
{{ $ep }}
@endforeach
@endif {{-- LLM Top 10 表格 --}} @php $llmRows = [ 'LLM01:2025' => ['提示注入', 'Prompt Injection'], 'LLM02:2025' => ['敏感資訊洩漏', 'Sensitive Information Disclosure'], 'LLM03:2025' => ['供應鏈漏洞', 'Supply Chain Vulnerabilities'], 'LLM04:2025' => ['資料與模型投毒', 'Data and Model Poisoning'], 'LLM05:2025' => ['不當輸出處理', 'Improper Output Handling'], 'LLM06:2025' => ['過度自主行為', 'Excessive Agency'], 'LLM07:2025' => ['系統提示詞洩漏', 'System Prompt Leakage'], 'LLM08:2025' => ['向量與嵌入弱點', 'Vector and Embedding Weaknesses'], 'LLM09:2025' => ['錯誤資訊', 'Misinformation'], 'LLM10:2025' => ['無限制資源消耗', 'Unbounded Consumption'], ]; $llmSolMap = [ 'LLM01:2025' => '實作輸入驗證;使用特權層級分離系統提示;對模型輸出進行後處理驗證。', 'LLM02:2025' => '對輸出內容進行 PII 偵測與遮蔽;設定系統提示禁止洩漏機密;實作輸出過濾器。', 'LLM03:2025' => '使用受信任來源的模型;定期掃描依賴套件漏洞;維護 SBOM。', 'LLM04:2025' => '驗證訓練資料來源與完整性;定期以紅隊測試評估模型行為;監控推論結果。', 'LLM05:2025' => '對 LLM 輸出進行嚴格的輸出編碼;視 LLM 輸出為不受信任的輸入。', 'LLM06:2025' => '採用最小權限原則;對高影響操作要求人工確認;限制 Agent 外部網路存取。', 'LLM07:2025' => '不在系統提示詞中存放敏感認證;定期測試模型對提示詞揭露請求的回應。', 'LLM08:2025' => '實作嚴格的向量資料庫存取控制;使用加密儲存向量。', 'LLM09:2025' => '提供引用來源;對關鍵輸出進行人工審核;明確標示 AI 生成內容。', 'LLM10:2025' => '實作請求速率限制與 Token 配額;設定最大 Token 上限;監控異常使用模式。', ]; @endphp @foreach($llmRows as $lid => [$lname, $len]) @php $lcnt = $byLlmOwasp[$lid] ?? 0; @endphp @endforeach
分類 ID 風險名稱 發現數 修復建議摘要
{{ $lid }}
{{ $lname }}
{{ $len }}
{{ $lcnt > 0 ? $lcnt : '—' }} @if($lcnt > 0){{ $llmSolMap[$lid] ?? '' }}@else—@endif
@endif {{-- isAiMode --}} {{-- 5. 修補建議優先順序 --}} @php // 修補建議:有 remediation 或有 zapPlugin 說明的非 info 項目 $fixFindings = array_filter($findings, function($f) use ($zapPlugins) { if (!in_array($f['severity'] ?? '', ['critical','high','medium','low'])) return false; $pid = (string)($f['extra']['plugin_id'] ?? ''); return !empty($f['remediation']) || (!empty($pid) && isset($zapPlugins[$pid])); }); @endphp @if(!empty($fixFindings))
五、修補建議優先順序
@php $rank = 1; @endphp @foreach($findings as $f) @php $fSev = $f['severity'] ?? ''; if (!in_array($fSev, ['critical','high','medium','low'])) continue; $pid2 = (string)($f['extra']['plugin_id'] ?? ''); $pInfo2 = $pid2 ? ($zapPlugins[$pid2] ?? null) : null; $sol = !empty($f['remediation']) ? $f['remediation'] : ($pInfo2['sol'] ?? ''); if (!$sol) continue; @endphp @endforeach
優先 嚴重度 漏洞名稱 建議修復措施
{{ $rank++ }} {{ strtoupper($fSev) }} {{ $f['name'] ?: ($f['template_id'] ?? '—') }} {{ mb_strimwidth($sol, 0, 150, '…') }}
@endif {{-- 6. 詳細發現清單 --}}
{{ empty($hasFix) ? '五' : '六' }}、詳細發現清單(共 {{ $total }} 筆)
@forelse($findings as $i => $f) @php $sev = $f['severity'] ?? 'info'; $pid = (string)($f['extra']['plugin_id'] ?? ''); $pInfo = $pid ? ($zapPlugins[$pid] ?? null) : null; $descText = !empty($f['description']) ? $f['description'] : ($pInfo['desc'] ?? ''); $remedText= !empty($f['remediation']) ? $f['remediation'] : ($pInfo['sol'] ?? ''); $fOwasp = (array)($f['owasp'] ?? []); $fCve = (array)($f['cve_id'] ?? []); $fRef = (array)($f['reference'] ?? []); // 自動補充參考連結 if (empty($fRef)) { foreach ($fOwasp as $oid) { $fRef[] = 'https://owasp.org/Top10/'; } if ($pid) $fRef[] = 'https://www.zaproxy.org/docs/alerts/'.$pid.'/'; } $sevColors = ['critical'=>'#dc2626','high'=>'#ea580c','medium'=>'#d97706','low'=>'#16a34a','info'=>'#475569']; $sevColor = $sevColors[$sev] ?? '#475569'; @endphp
{{ strtoupper($sev) }}
#{{ str_pad($i+1, 3, '0', STR_PAD_LEFT) }}
{{ $f['name'] ?: ($f['template_id'] ?? '—') }}
{{ $f['template_id'] ?? '' }} @foreach($fCve as $cid)  {{ $cid }} @endforeach @foreach($fOwasp as $oid)  {{ $oid }} @endforeach @if($isAiMode) @foreach((array)($f['llm_owasp'] ?? []) as $lid)  {{ $lid }} @endforeach @endif
{{-- 影響網址位置(獨立一行,突出顯示)--}}
🌍 影響網址位置
{{ $f['matched_at'] ?: '—' }}
{{-- 三欄:風險分類 ╱ 漏洞說明+解法 ╱ 參考資料 --}}
{{-- 欄A:對應風險分類 --}}
⚠ 對應風險分類
@php $sevDescs = [ 'critical'=>'可直接被遠端利用,無需授權即可取得系統控制權。建議立即(24H內)修復。', 'high' =>'可能造成資料洩漏、身分驗證繞過等重大損害。建議 7 天內修復。', 'medium' =>'單獨利用危害有限,但可與其他漏洞組合使用。建議 30 天內修復。', 'low' =>'危害程度較低,通常為設定不當或資訊暴露。建議例行維護時修復。', 'info' =>'非直接威脅,主要為技術指紋識別,可輔助了解系統暴露面。', ]; @endphp
{{ strtoupper($sev) }}
{{ $sevDescs[$sev] ?? '' }}
@if(!empty($fOwasp))
OWASP Top 10 2021
@foreach($fOwasp as $oid) @php $od = $owaspDetail[$oid] ?? null; @endphp
{{ $oid }} {{ $od['name'] ?? '' }}
@if($od)
{{ $od['desc'] }}
@endif
@endforeach
@endif @if(!empty($fCve))
@foreach($fCve as $cid) {{ $cid }} @endforeach
@endif
{{-- 欄B:漏洞說明 + 建議解法 --}}
ℹ 漏洞說明
@if($descText)
{{ $descText }}
@else
(請參考右側參考資料)
@endif
🔧 建議解法
@if($remedText)
{{ $remedText }}
@else
(請參考 OWASP 防禦指南)
@endif
{{-- 欄C:參考資料 + 技術資訊 --}}
🔗 參考資料
@foreach(array_slice($fRef, 0, 4) as $ref)
{{ $ref }}
@endforeach
📄 技術資訊
@if(!empty($f['template_id']))
ID:{{ $f['template_id'] }}
@endif @if(!empty($f['type']))
類型:{{ strtoupper($f['type']) }}
@endif @if(!empty($f['extra']['count']))
發現次數:{{ $f['extra']['count'] }} 處
@endif @if(!empty($f['extra']['cvss_score']))
CVSS:{{ $f['extra']['cvss_score'] }}
@endif @if(!empty($f['extra']['synopsis']))
{{ mb_strimwidth($f['extra']['synopsis'],0,80,'…') }}
@endif
@if(!empty($f['tags']))
@foreach(array_slice((array)$f['tags'], 0, 6) as $tag) {{ $tag }} @endforeach
@endif
{{-- finding-detail --}}
@empty

未發現任何問題,系統安全狀態良好。

@endforelse
{{-- end .page --}}