dimitriremoiville/cc-mobile/flutter-security
Claude Code and agent skill by dimitriremoiville/cc-mobile
- community
Checking that the SKILL.md file is still in the repository.
Flutter security patterns — secure storage via `flutter_secure_storage`, Dio + cert pinning, App Check, root/jailbreak detection, deep-link validation, WebView hardening, in-app auth flows. Load whenever adding auth, secrets, or network calls crossing a trust boundary.
Install
npx vskill@latest install dimitriremoiville/cc-mobile/flutter-securitySKILL.md
The same SKILL.md was published earlier as dimitriremoiville/cc-mobile/flutter-security.
Flutter security
Secrets at rest
flutter_secure_storage — backed by Keychain (iOS) and Keystore + EncryptedSharedPreferences (Android):
- Always
this_deviceaccessibility — neverkSecAttrAccessibleAlwaysequivalents that sync to iCloud. - Don't store refresh tokens in
SharedPreferences/NSUserDefaults. - Wrap behind a
SecureStoreinterface so tests can inject a fake.
Certificate pinning
With Dio via dio_certificate_pinner or a custom HttpClientAdapter. Pin the SPKI, ship two pins (current + next), rotate one release before the server rotates.
On mobile, prefer http_certificate_pinning or SDK-level pinning; the validator must fail closed — return false on unknown cert, no exceptions.
App Check
Pair with Firebase App Check (see firebase-services) so non-app clients can't call your backend. Server validates the App Check token on each request.
Root / jailbreak detection
flutter_jailbreak_detection gives a best-effort signal. Use it as a risk signal (require re-auth, disable payment flows), never as a hard block on a legit user with a custom ROM.
Deep-link validation
Universal / App Links + Android App Links are the only safe scheme. Custom schemes (myapp://...) are not exclusive to your app and can be hijacked.
- Server-hosted
apple-app-site-association(iOS) andassetlinks.json(Android). - Validate every incoming link's origin before acting:
Never trust a deep link to reset state, refresh tokens, or navigate to destructive actions without an additional in-app confirmation.
In-app auth (OAuth)
Use flutter_appauth or firebase_auth, not a hand-rolled redirect. Reasons:
- Handles PKCE correctly.
- Uses
SFAuthenticationSession(iOS) / Custom Tabs (Android), so the user sees Apple / Chrome chrome and cookies persist in the right jar. - Secrets stay on the backend.
Client secret is not in the binary. PKCE means you don't need one.
WebView hardening
Use webview_flutter or flutter_inappwebview carefully:
javaScriptMode: JavaScriptMode.disabledunless the content needs it.setAllowFileAccess(false),setAllowContentAccess(false),setAllowFileAccessFromFileURLs(false),setAllowUniversalAccessFromFileURLs(false)on Android.- Inject no JavaScript that ships secrets.
- Prefer
url_launcherwith external browser / Custom Tabs for third-party HTML.
Logging
debugPrintonly in debug:if (kDebugMode) debugPrint(...).- Never log tokens, URLs containing tokens, PII, or decoded JWT bodies.
- Crashlytics records unhandled errors automatically; scrub identifiers in your
onErrorhook if needed.
Proguard / R8 on Android
build.gradle.kts:
Keep reflection targets (Firebase, any generated serializer) via rules files.
iOS hardening
Info.plist: remove unused permissions (camera, mic) — Apple rejects apps that request without use.NSFileProtectionType: NSFileProtectionCompleteUntilFirstUserAuthenticationat minimum;NSFileProtectionCompletefor highly sensitive files.- Never ship with
NSAllowsArbitraryLoads.
Dependency hygiene
dart pub outdated --mode=null-safety.pub audit(if your org runs a proxy) or a GitHub Dependabot-equivalent.- Pin exact versions for anything touching auth / crypto. Use
^x.y.zfor UI-only libs.
Hard nos
- No storing tokens in
SharedPreferences/NSUserDefaults. - No
badCertificateCallback = (_, __, ___) => true, not even behindkDebugMode. UseSecurityContextwith a dev cert instead. - No
Platform.isIOS || Platform.isAndroidsecurity gates — a malicious user sees both paths. - No WebView rendering untrusted HTML with JS enabled.
- No hard-coded OAuth client secrets or API keys in
lib/.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/cc-mobile-flutter/skills/flutter-security/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/dimitriremoiville/cc-mobile/flutter-security)