KS
Killer-Skills

security-review — how to use security-review how to use security-review, security-review for Flutter, secure Dart projects, security-review setup guide, security-review vs OWASP, security-review install, what is security-review, security-review best practices, security-review for API security

v1.0.0
GitHub

About this Skill

Perfect for Mobile App Security Agents needing comprehensive Flutter/Dart project audits. security-review is a skill that provides a set of security principles and checks to ensure Flutter/Dart projects are secure, including machine credential management and secure API integration

Features

Provides a security checklist for Flutter/Dart projects
Supports secure credential management using --dart-define or .env files
Ensures sensitive files like .env and google-services.json are ignored by git
Helps manage device permissions for camera and storage
Guides secure API key and token handling

# Core Topics

tarrragon tarrragon
[0]
[0]
Updated: 3/3/2026

Quality Score

Top 5%
36
Excellent
Based on code quality & docs
Installation
SYS Universal Install (Auto-Detect)
Cursor IDE Windsurf IDE VS Code IDE
> npx killer-skills add tarrragon/ccsession/security-review

Agent Capability Analysis

The security-review MCP Server by tarrragon is an open-source Categories.community integration for Claude and other AI agents, enabling seamless task automation and capability expansion. Optimized for how to use security-review, security-review for Flutter, secure Dart projects.

Ideal Agent Persona

Perfect for Mobile App Security Agents needing comprehensive Flutter/Dart project audits.

Core Value

Empowers agents to identify and fix vulnerabilities in Flutter/Dart projects, ensuring secure handling of sensitive user data and APIs through principles like secret management and secure API key handling.

Capabilities Granted for security-review MCP Server

Auditing Flutter/Dart projects for security vulnerabilities
Implementing secure authentication and authorization mechanisms
Validating API key and secret management practices

! Prerequisites & Limits

  • Requires knowledge of Flutter/Dart ecosystem
  • Limited to Flutter/Dart projects
  • Needs access to project codebase for comprehensive analysis
Project
SKILL.md
7.5 KB
.cursorrules
1.2 KB
package.json
240 B
Ready
UTF-8

# Tags

[No tags]
SKILL.md
Readonly

Security Review(Flutter/Dart)

Flutter/Dart 專案的安全審查快速指引。本 Skill 提供安全檢查清單和核心原則,詳細程式碼範例請參考 references/flutter-security-patterns.md


適用場景

  • 實作認證或授權功能
  • 處理使用者輸入(表單、掃描結果)
  • 使用 API Key 或其他機密
  • 整合第三方 API(Google Books、Dio 等)
  • 儲存或傳輸敏感資料
  • 管理裝置權限(相機、儲存)
  • 準備 Release 建置或上架

1. 機密管理

原則:機密不可出現在原始碼或版本控制中。

檢查清單

  • 無硬編碼 API Key、Token、密碼
  • 機密透過 --dart-define.env 注入
  • .env*.keystorekey.properties 已加入 .gitignore
  • google-services.json / GoogleService-Info.plist 已加入 .gitignore
  • Git 歷史中無機密洩漏

核心模式

dart
1// 正確:建置時注入 2const apiKey = String.fromEnvironment('API_KEY', defaultValue: ''); 3 4// 錯誤:硬編碼 5const apiKey = 'sk-proj-xxxxx'; // 禁止

詳細範例:references/flutter-security-patterns.md 第 1 節


2. 輸入驗證

原則:所有使用者輸入在處理前必須驗證和清理。

檢查清單

  • 所有表單欄位有 validator
  • 設定 maxLength 限制輸入長度
  • 使用白名單驗證(非黑名單)
  • 掃描結果(ISBN barcode)已清理非預期字元
  • 錯誤訊息不洩漏技術細節

核心模式

dart
1// 表單驗證 2TextFormField( 3 validator: (value) { 4 if (value == null || value.trim().isEmpty) return '必填'; 5 if (value.length > maxLength) return '超過長度限制'; 6 return null; 7 }, 8 inputFormatters: [ 9 FilteringTextInputFormatter.deny(RegExp(r'[<>{}]')), 10 ], 11)

詳細範例:references/flutter-security-patterns.md 第 2 節


3. 本地資料安全

原則:敏感資料使用加密儲存,一般偏好設定可用明文。

檢查清單

  • 機密資料使用 flutter_secure_storage(非 SharedPreferences
  • SQLite 查詢使用參數化(? 佔位符)
  • 無 SQL 字串拼接
  • SharedPreferences 中無 Token、密碼、個資

核心模式

dart
1// 正確:參數化查詢 2await db.rawQuery('SELECT * FROM books WHERE title LIKE ?', ['%$query%']); 3 4// 錯誤:字串拼接(SQL 注入) 5await db.rawQuery("SELECT * FROM books WHERE title LIKE '%$query%'");

儲存選擇指引

資料類型儲存方式
Token、密碼、API Keyflutter_secure_storage
使用者偏好(主題、語言)SharedPreferences
結構化業務資料sqflite(參數化查詢)
暫存檔案path_provider 暫存目錄

詳細範例:references/flutter-security-patterns.md 第 3 節


4. 網路安全

原則:所有網路通訊使用 HTTPS,驗證回應結構。

檢查清單

  • 所有 API 端點使用 HTTPS
  • 設定合理的連線逾時(connectTimeoutreceiveTimeout
  • API 回應結構已驗證(型別檢查)
  • Token 透過攔截器注入(非手動拼接)
  • 401 回應時清除本地 Token

核心模式

dart
1// Dio 安全配置 2final dio = Dio(BaseOptions( 3 baseUrl: 'https://api.example.com', // HTTPS only 4 connectTimeout: const Duration(seconds: 10), 5 receiveTimeout: const Duration(seconds: 15), 6)); 7 8// 攔截器注入 Token 9dio.interceptors.add(InterceptorsWrapper( 10 onRequest: (options, handler) async { 11 final token = await storage.readToken(); 12 if (token != null) { 13 options.headers['Authorization'] = 'Bearer $token'; 14 } 15 handler.next(options); 16 }, 17));

詳細範例:references/flutter-security-patterns.md 第 4 節


5. 權限管理

原則:僅請求必要權限,在需要時才請求,並說明用途。

檢查清單

  • 僅宣告實際需要的權限(AndroidManifest / Info.plist)
  • 權限在使用前才請求(非啟動時全部請求)
  • iOS Info.plist 每個權限有用途說明字串
  • 處理「永久拒絕」狀態(引導到系統設定)
  • 權限被拒時提供替代方案或提示

核心模式

dart
1// 按需請求,處理各種狀態 2Future<bool> requestCameraPermission() async { 3 final status = await Permission.camera.status; 4 if (status.isGranted) return true; 5 if (status.isDenied) { 6 final result = await Permission.camera.request(); 7 return result.isGranted; 8 } 9 if (status.isPermanentlyDenied) { 10 await openAppSettings(); 11 return false; 12 } 13 return false; 14}

詳細範例:references/flutter-security-patterns.md 第 5 節


6. 認證與授權

原則:Token 安全儲存,過期自動處理,敏感操作前驗證狀態。

檢查清單

  • Token 使用 flutter_secure_storage 儲存
  • Token 過期有自動更新機制
  • 登出時清除所有本地 Token
  • 敏感操作前驗證使用者認證狀態
  • Refresh Token 失敗時跳轉登入頁面

詳細範例:references/flutter-security-patterns.md 第 6 節


7. 依賴安全

原則:定期檢查依賴漏洞,鎖定版本確保可重現建置。

檢查清單

  • flutter pub audit 無已知漏洞
  • flutter pub outdated 定期執行
  • pubspec.lock 已提交到版本控制
  • 依賴版本有合理約束(使用 ^ 語法)
  • CI/CD 使用 --enforce-lockfile 確保一致性

核心指令

bash
1flutter pub audit # 檢查已知漏洞 2flutter pub outdated # 檢查過時套件 3flutter pub upgrade # 更新依賴

詳細範例:references/flutter-security-patterns.md 第 7 節


8. 敏感資料外洩防護

原則:日誌不含敏感資料,錯誤訊息不洩漏技術細節。

檢查清單

  • 日誌中無 Token、密碼、個人資料
  • 使用者看到的錯誤訊息為通用文字(透過 i18n / ErrorHandler)
  • 技術細節僅記錄到開發日誌(kDebugMode 判斷)
  • Release 建置不輸出除錯日誌
  • Stack Trace 不暴露給使用者

核心模式

dart
1// 正確:Release 模式下不輸出日誌 2if (kDebugMode) { 3 debugPrint('API Error: ${error.runtimeType}'); 4} 5 6// 正確:使用 ErrorHandler 轉換錯誤訊息 7final userMessage = ErrorHandler.getUserMessage(exception); 8 9// 錯誤:直接暴露技術細節 10// showError('Database error: $sqlException at line 42');

詳細範例:references/flutter-security-patterns.md 第 8 節


上架前安全檢查清單

Release 建置或上架前,逐項確認:

  • 機密:無硬編碼機密,全部透過環境變數注入
  • 輸入驗證:所有使用者輸入已驗證
  • SQL 注入:所有查詢參數化
  • 本地儲存:敏感資料使用加密儲存
  • HTTPS:所有網路通訊使用 HTTPS
  • 權限:僅宣告必要權限,有用途說明
  • 認證:Token 安全儲存和自動更新
  • 日誌:Release 建置無敏感資料輸出
  • 依賴flutter pub audit 無漏洞
  • 錯誤處理:使用者看不到技術細節
  • ProGuard/R8:Android Release 啟用程式碼混淆
  • App Transport Security:iOS 已正確設定

參考資源


Last Updated: 2026-03-02

Related Skills

Looking for an alternative to security-review or building a Categories.community AI Agent? Explore these related open-source MCP Servers.

View All

widget-generator

Logo of f
f

widget-generator is an open-source AI agent skill for creating widget plugins that are injected into prompt feeds on prompts.chat. It supports two rendering modes: standard prompt widgets using default PromptCard styling and custom render widgets built as full React components.

149.6k
0
Design

chat-sdk

Logo of lobehub
lobehub

chat-sdk is a unified TypeScript SDK for building chat bots across multiple platforms, providing a single interface for deploying bot logic.

73.0k
0
Communication

zustand

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
Communication

data-fetching

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
Communication