HTTP 回應標頭安全與快取稽核工具
在瀏覽器 100% 本機稽核貼上的 HTTP 回應標頭,完整檢測 HSTS、CSP、X-Frame-Options、Referrer-Policy、Permissions-Policy、Set-Cookie、COOP/CORP 與 Cache-Control。
| Header | Status | Observed | Finding & Fix |
|---|---|---|---|
Strict-Transport-Security Security | fail | Missing | HTTPS enforcement header is absent, allowing downgrade or SSL-stripping risks. Set max-age to at least 31536000 (1 year) with includeSubDomains. |
Content-Security-Policy Security | fail | default-src * 'unsafe-inline' 'unsafe-eval' | CSP permits 'unsafe-eval', weakening XSS protection. Remove 'unsafe-eval', wildcards, and http:// sources; use nonces/hashes. |
X-Frame-Options Security | fail | Missing | Missing clickjacking protection (neither X-Frame-Options nor CSP frame-ancestors). Set X-Frame-Options: DENY (or SAMEORIGIN). |
X-Content-Type-Options Security | fail | Missing | Browser MIME-type sniffing is not disabled. Set X-Content-Type-Options: nosniff. |
Referrer-Policy Security | fail | Missing | Referrer-Policy header is missing. Set Referrer-Policy: strict-origin-when-cross-origin. |
Permissions-Policy Security | warn | Missing | Permissions-Policy is not set to restrict powerful browser APIs. Restrict camera, microphone, geolocation, and payment APIs. |
Set-Cookie Cookies | fail | session=abc123; Path=/ | session missing Secure, HttpOnly, SameSite Add Secure; HttpOnly; SameSite=Lax (or Strict) to every sensitive cookie. |
COOP / CORP Isolation | warn | Missing | Cross-Origin-Opener-Policy and Cross-Origin-Resource-Policy are absent. Add COOP: same-origin and CORP: same-origin to isolate browsing contexts. |
Cache-Control Caching | fail | public, max-age=600 | Response sets cookies while marking Cache-Control as public (risk of shared cache leak). Switch to Cache-Control: private, no-store when setting user cookies. |
Server / X-Powered-By Leakage | warn | Server: Apache/2.4.49 (Unix); X-Powered-By: PHP/8.1.2 | Runtime or server version fingerprint exposed in response headers. Strip X-Powered-By and omit exact software version numbers from Server. |
使用步驟
- 從 curl -I 輸出或瀏覽器 DevTools 網路面板複製原始 HTTP 回應標頭並貼入輸入框。
- 檢視整體 A+ 至 F 安全評級、通過/警告/失敗項目統計,以及逐條標頭診斷明細表。
- 點擊「複製修補標頭」或「下載報告」,迅速將建議的強化設定套用至您的伺服器或 CDN。
什麼是 HTTP 回應標頭安全與快取稽核工具?
HTTP 回應標頭安全與快取稽核工具是一款 100% 用戶端運作的標頭健檢分析器,免於掃描外部伺服器或暴露內部測試站台,即可為原始 HTTP 回應標頭計算出 A+ 到 F 的安全評級。它能精準找出缺少的傳輸安全強化、脆弱的 CSP 指令、不安全的 Cookie 旗標、跨來源隔離缺口與風險快取組合。
運作原理
當您貼上來自 curl -I 或瀏覽器 DevTools Network 分頁的回應標頭後,純 TypeScript 剖析器會不分大小寫擷取狀態列、多筆 Set-Cookie 與各個標頭值。接著執行十項加權安全、隔離、資訊洩漏與快取規則評分,並為所有警告或失敗項目合成可直接複製使用的修補標頭區塊。
常見使用情境
- 稽核外部線上掃描器無法連線存取的本機開發環境或內部測試站台 HTTP 回應標頭
- 揪出 Content-Security-Policy 中具備安全隱患的 'unsafe-eval'、'unsafe-inline' 或萬用字元 * 設定
- 驗證工作階段專用的 Set-Cookie 標頭是否確實啟用了 Secure、HttpOnly 與 SameSite 屬性
- 檢視 CDN 的 Cache-Control 與 stale-while-revalidate 策略,避免誤將含 Cookie 的私有回應快取外洩
技術細節
零網路連線的靜態剖析引擎,支援 HTTP/1.x 與 HTTP/2 狀態列、curl -v 的「< 」前綴格式、CSP 指令分詞、多筆 Cookie 旗標檢核、COOP/CORP 跨來源隔離驗證、Server/X-Powered-By 版本指紋洩漏檢查以及自動化修補標頭合成。
常見問題
這個稽核工具會對我的網站發出任何網路請求嗎?
不會。您只需直接貼上來自瀏覽器 DevTools 或 curl -I 的回應標頭文字,所有安全與快取規則都會在您的瀏覽器中完全離線評估計算。
決定 A+ 到 F 評級的安全檢查項目包含哪些?
稽核器會全面評估 Strict-Transport-Security、Content-Security-Policy(標記 unsafe-eval、unsafe-inline 與萬用字元)、X-Frame-Options、X-Content-Type-Options、Referrer-Policy、Permissions-Policy、Set-Cookie 旗標、COOP/CORP 隔離以及 Cache-Control 安全性。
為什麼 Cache-Control 快取設定也會影響安全性?
若在設定工作階段 Cookie 的同時回傳 Cache-Control: public,CDN 或共用代理伺服器可能會快取屬於特定使用者的私密頁面內容。機密回應應使用 private, no-store,而靜態資源才適合搭配 max-age 與 stale-while-revalidate。