Frontend Review Securityのロゴ

Frontend Review Security

コミュニティ
mizchi
frontend-review-security

フロントエンドのセキュリティレビューを実施するときに使用します。静的解析(危険なHTMLパターン、環境変数の露出)、認証・認可の監査(トークンの保存、ルートガード、ログアウト)、AIによる自己侵入テストを行います。`scripts/audit-security.sh`を実行します。CVEのトリアージや非推奨ライブラリの検出には、`frontend-review-deps`を使用してください。

Add to TypingMind

概要

公開者mizchi
リポジトリskills
スキル名frontend-review-security
スター
333
フォーク
4
同梱ファイル
指示のみ
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    mizchiがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Frontend Review Security」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/mizchi/skills/tree/main/frontend-review-security
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/mizchi/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/frontend-review-security .claude/skills/frontend-review-security
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでFrontend Review Securityを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にFrontend Review Securityを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Frontend Review Securityは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Frontend Review — Security

You are performing a frontend security review. The focus areas are:

  1. Static — risky HTML sinks, environment variable exposure in client bundles
  2. Auth / Authorization — token storage, route guards, session management
  3. AI self-pentest — desk-check of common vulnerability patterns
  4. Staging environment — HTTP headers, auth boundaries, cookie flags

Procedure

  1. Run scripts/audit-security.sh --repo <client-repo>.
  2. Read raw/security.json.
  3. For each dangerouslySetInnerHTML / v-html / .innerHTML = hit, locate the file and judge whether the input is sanitized.
  4. Run the Authentication & Authorization review (see below).
  5. Run the Env / Config review (see below).
  6. For AI self-pentest, mentally walk through the attack scenarios below.
  7. For staging, draft the header checklist.

Authentication & Authorization Review

Token storage

Check where access tokens are stored and flag insecure patterns:

StorageRiskVerdict
httpOnly CookieJS-inaccessible, XSS-resistant✅ Recommended
localStorageReadable by any JS on the page — XSS steals it⚠ Flag + require XSS mitigations
sessionStorageSame XSS risk as localStorage⚠ Flag
In-memory (module variable)Lost on reload; only viable in short-lived SPAsContext-dependent
  • Check whether the refresh token is also stored in httpOnly Cookie.
  • Check whether the access token lifetime is short (recommended: 15 min – 1 hour).

Route guards

  • Does ProtectedRoute (or equivalent) have a loading state that prevents a flash of the protected page before auth status resolves?
tsx
// Bad: no loading state — redirects to /login during initial auth check
if (!user) return <Navigate to="/login" />;

// Good: loading state prevents flash
if (isLoading) return <LoadingSpinner />;
if (!user) return <Navigate to={`/login?redirect=${encodeURIComponent(location.pathname)}`} />;
  • Does the app redirect back to the original page after login (redirect / redirect_to param)?
  • Server-side authorization exists for every protected API endpoint — frontend guards alone can be bypassed via DevTools or curl.

Token refresh

  • Does the API client auto-retry on 401 by refreshing the token first?
  • Is refresh deduplicated so that parallel 401s don't trigger multiple refresh calls?
ts
let refreshPromise: Promise<string> | null = null;
async function refreshToken(): Promise<string> {
  if (refreshPromise) return refreshPromise;
  refreshPromise = doRefresh().finally(() => { refreshPromise = null; });
  return refreshPromise;
}

Logout

  • Does logout call the server endpoint AND clear all client-side state?
ts
// Required logout sequence:
await api.post('/auth/logout');   // revoke server-side session
queryClient.clear();              // clear TanStack Query cache
authStore.reset();                // clear Zustand / Jotai auth atoms
router.replace('/login');        // navigate away before clearing is dangerous
  • After logout, does a hard-reload show the previous user's data? (Check: TanStack Query devtools, React state, localStorage)

Env / Config Review

  • VITE_ / NEXT_PUBLIC_ prefixed variables must not contain secrets. Vite / Next.js embed these into the client bundle — anyone can read them in DevTools.
  • .env must not be committed. Run: git log --all --full-history -- '*.env'
  • Is src/config.ts (or equivalent) the single entry point for env var reads? Direct import.meta.env.VITE_FOO calls scattered in components are a review red flag.
  • Does config.ts throw at startup if a required env var is missing?
ts
// config.ts — startup-time validation
const requireEnv = (key: string): string => {
  const value = import.meta.env[key];
  if (!value) throw new Error(`Missing required env var: ${key}`);
  return value;
};
  • Is ImportMetaEnv extended in vite-env.d.ts so that unknown VITE_* keys are caught by TypeScript?

AI Self-Pentest Scenarios

Walk through each scenario mentally and note: OK / finding / unable-to-determine.

  1. XSS via URL parameter — does a malicious ?q=<script>alert(1)</script> get rendered unsanitized?
  2. XSS via form input — is user-supplied HTML ever rendered with dangerouslySetInnerHTML without sanitization?
  3. CSRF — do state-mutating API calls require a CSRF token or use SameSite=Strict cookies?
  4. Auth boundary bypass — can an unauthenticated fetch('/api/protected') return data?
  5. Sensitive data in storage — does localStorage.getItem reveal tokens, PII, or session data?
  6. Client-side-only authorization — are there role checks in React code that are not mirrored server-side?
  7. Open redirect — does the redirect / next login parameter allow arbitrary external URLs?

Staging Checklist

Draft these for the human to run against the deployed staging URL:

  • Content-Security-Policy header is present and restrictive
  • Strict-Transport-Security (HSTS) with max-age ≥ 31536000
  • X-Frame-Options: DENY or SAMEORIGIN
  • X-Content-Type-Options: nosniff
  • Cookies have Secure, HttpOnly, SameSite=Strict (or Lax)
  • GET /api/me without a valid session returns 401, not user data
  • GET /api/admin-only as a regular user returns 403, not data

Output

Write <client-repo>/.frontend-review/report/latest/md/security-review.md with:

  • Static findings (risky sinks, env var exposure)
  • Auth / Authorization findings (token storage, route guard gaps, logout issues)
  • AI pentest notes (each scenario: OK / finding / unable-to-determine)
  • Staging checklist (to be executed by the human)
  • Issues to file (gh issue create commands with titles and bodies)

Do NOT execute the gh issue create commands yourself — print them for the human.

Boundaries

  • Do NOT attempt actual exploitation. This is a desk review.
  • Do NOT run scanners against production URLs.
  • Do NOT touch the client source code.
  • CVE triage and trend-watch are handled by frontend-review-deps.

Reference

よくある質問

AIスキル「Frontend Review Security」では何ができますか?

フロントエンドのセキュリティレビューを実施するときに使用します。静的解析(危険なHTMLパターン、環境変数の露出)、認証・認可の監査(トークンの保存、ルートガード、ログアウト)、AIによる自己侵入テストを行います。`scripts/audit-security.sh`を実行します。CVEのトリアージや非推奨ライブラリの検出には、`frontend-review-deps`を使用してください。

TypingMindでFrontend Review Securityを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Frontend Review Securityはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにFrontend Review Securityをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/mizchi/skills/tree/main/frontend-review-securityを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Frontend Review Securityを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Frontend Review Securityで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもFrontend Review Securityを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Frontend Review Security」は無料ですか?

mizchiがGitHubで公開しています。ライセンス条件はリポジトリでご確認ください。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇