mobile-security
Skill22 starsChanged 5 months agoMITView on GitHub
Android and iOS hardening on a device you do not control: hardware-backed credential storage, exported components and IPC, verified deep links, transport defaults and pinning rotation, server-side attestation over client-side root detection, screen capture, and release-build hygiene — including React Native and Flutter packaging. Use when generating Android or iOS app code, manifests, or native modules, wiring deep links or WebViews, or deciding what a mobile client is trusted to assert.
6 other projects use a version of this.
Adopted by
Most recently taken up by
- Kur1sulab/blackboxtheir own version, first seen Aug 12, 2026
- ahmed3elshaer/everything-claude-code-mobiletheir own version, first seen Jun 14, 2026
- langbyyi/websec-skillstheir own version, first seen Jun 12, 2026
- kalshamsi/claude-security-skillstheir own version, first seen Apr 15, 2026
- transilienceai/communitytoolstheir own version, first seen Mar 30, 2026
- ffsshhttiikk/opencode-agents-skillstheir own version, first seen Feb 28, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- transilienceai/communitytools★ 555same name
- ahmed3elshaer/everything-claude-code-mobile★ 66same name
- langbyyi/websec-skills★ 4same name
- Kur1sulab/blackbox★ 3same name
- ffsshhttiikk/opencode-agents-skills★ 2same name
- kalshamsi/claude-security-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository36 other files it gives its agents.
- AGENTS.mdAGENTS.md
- dist/AGENTS.mdAGENTS.md
- dist/CLAUDE.mdCLAUDE.md
- dist/copilot-instructions.mdCopilot instructions
- docs/llms-full.txtllms.txt
- docs/llms.txtllms.txt
- api-securitySkill
- auth-securitySkill
- cicd-securitySkill
- container-securitySkill
- cors-securitySkill
- crypto-misuseSkill
- database-securitySkill
- deserialization-securitySkill
- dynamic-verificationSkill
- electron-securitySkill
- error-handling-securitySkill
- file-upload-securitySkill
- frontend-securitySkill
- graphql-securitySkill
- iac-securitySkill
- iam-best-practicesSkill
- llm-app-securitySkill
- logging-securitySkill
- ml-securitySkill
- protocol-securitySkill
- saas-securitySkill
- secret-detectionSkill
- secure-code-reviewSkill
- security-regression-testsSkill
- serverless-securitySkill
- ssrf-preventionSkill
- supply-chain-securitySkill
- template-injectionSkill
- threat-modelingSkill
- websocket-securitySkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 1 is distinctive, and 4 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 35
Start from the premise that the device belongs to whoever is holding it.
- Very specific: line 44
Keep credentials in the platform's hardware-backed store: Android Keystore (EncryptedSharedPreferences with a MasterKey), iOS Keychain with …
- Very specific: line 56
Treat data crossing an app boundary as untrusted in both directions: validate every Intent extra and incoming activity payload, send …
- Very specific: line 60
Verify deep links instead of trusting the scheme.
- Very specific: line 65
Keep the platform's transport defaults: ATS enabled in Info.plist, an Android networkSecurityConfig that denies cleartext, and any …
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Mobile Application Security
Rules (for AI agents)
ALWAYS
- Start from the premise that the device belongs to whoever is holding it. The app runs on hardware an attacker can root or jailbreak, instrument at runtime, and read at rest. Everything shipped in the package is extractable, every client-side check is removable, and every local check can be made to return the answer the attacker wants. What you actually control is the backend's willingness to act — so any decision that matters is made server-side, on evidence the server verified.
- Issue short-lived, device-scoped tokens from a backend rather than shipping an API
key, signing key, or backend credential in source, resources,
strings.xml,BuildConfig, orInfo.plist. Anyone can download the package and read it. - Keep credentials in the platform's hardware-backed store: Android Keystore
(
EncryptedSharedPreferenceswith aMasterKey), iOS Keychain with a…ThisDeviceOnlyaccessibility class —WhenUnlockedwhere the value is never needed in the background,AfterFirstUnlockwhere it is. NeverSharedPreferences,UserDefaults, a plist, or a file. The store protects a key at rest on an uncompromised device; it does not protect against code running inside your process, which is why the credential should be short-lived regardless. - Android: give every
<activity>,<service>,<receiver>and<provider>an explicitandroid:exported, defaulting tofalse. Since API 31 the attribute is mandatory when an intent filter is present — which forces the question to be asked, not answered. An exported component is a public API of your app that any installed application can call. - Treat data crossing an app boundary as untrusted in both directions: validate every
Intentextra and incoming activity payload, send sensitive data with an explicit component rather than an implicit intent any app can register for, and create everyPendingIntentasFLAG_IMMUTABLEso the recipient cannot rewrite its contents. - Verify deep links instead of trusting the scheme. A custom scheme (
myapp://) can be claimed by any app that declares it; Android App Links (android:autoVerify) and iOS Universal Links are bound to a domain you control and are the only form carrying an ownership proof. Where the link carries an authentication callback,auth-securityowns thestate/ PKCE check that makes it safe. - Keep the platform's transport defaults: ATS enabled in
Info.plist, an AndroidnetworkSecurityConfigthat denies cleartext, and any exception scoped to a named host rather than the whole app. Where you add certificate pinning for a backend you own, plan its rotation at the same time — a backup pin for the next certificate, a tracked expiry, and a remote kill-switch. A pin that expires bricks every installed copy until users take a store update, which takes days. - Decide sensitive actions on server-verified attestation — Play Integrity, App Attest, DeviceCheck — rather than a client-side root or jailbreak check. A check running on the attacker's device is removable in minutes; an attestation is worth something because your server evaluates it. Client-side detection is a speed bump worth having on high-risk apps and is never the decision.
- Bind biometric authentication to a cryptographic operation: a Keystore key created
with
setUserAuthenticationRequired(true)and used throughBiometricPrompt, or a Keychain item guarded bykSecAccessControlBiometryCurrentSet. A boolean returned from a "did the user authenticate" API proves nothing — it can be patched to return true. - Protect sensitive screens from capture:
FLAG_SECUREon Android keeps a view out of screenshots and the recents thumbnail; on iOS, cover the window before the app is backgrounded, because the system snapshots the screen to render the app switcher. - Strip debug material from release builds — verbose logging,
android:debuggable, development endpoints, test credentials. Shrinking and minification (R8, ProGuard) are worth enabling for size and dead-code removal, but treat the renaming as a delay for a reverse engineer rather than a control. Nothing in the package is secret. - Consult
logging-securityfor what may be logged, with one mobile-specific twist: Logcat and oslog are readable from a connected device without root, so an HTTP logging interceptor left at body level in a release build publishes every request and itsAuthorizationheader to anyone with a cable.
NEVER
- Ship an app that trusts any certificate: an empty
X509TrustManagerimplementation, aURLSessionDelegatethat accepts every challenge, or ATS disabled app-wide withNSAllowsArbitraryLoads. This is still the most common security defect shipped in mobile apps. - Set
android:allowBackup="true"on an app holding credentials — the backup is readable from a developer machine. Exclude sensitive paths explicitly. - Load a user-controlled URL into
WebVieworWKWebViewwithout scheme validation, or enablesetAllowFileAccessFromFileURLs/setUniversalAccessFromFileURLs.frontend-securityowns what executes inside that web view. - Assume a cross-platform layer has handled any of this. A React Native JavaScript bundle sits readable inside the package, a Flutter AOT binary still contains its string literals, and plugin storage wrappers differ in whether they reach the hardware-backed store at all. The wrapper does not move the trust boundary.
KNOWN FALSE POSITIVES
- Public identifiers embedded in the binary — an analytics key, a public DSN, a Firebase configuration — belong there. The question is whether the backend authorizes anything on them.
debuggableon a debug variant is normal; the rule concerns release builds.- A custom URL scheme for an OAuth callback is expected. The control is
stateor PKCE verification plus an App Link or Universal Link where the platform supports one — not the absence of the scheme. - An app that deliberately runs on rooted devices (a developer tool, an emulator build) is not failing the attestation rule. That rule is about what the server decides, and the answer may legitimately be "allow".
Context (for humans)
Mobile security has one property that reorganises everything else: the attacker owns
the execution environment. On a server you can reason about what an attacker can
reach; on a phone they can attach a debugger to your process, patch a function to
return true, dump the keychain on a jailbroken device, and read every string in the
binary. No amount of client-side hardening changes that, which is why obfuscation and
root detection are cost multipliers rather than controls.
The practical consequence is that mobile findings sort into two piles. The first is
"we shipped something we should not have" — a credential in the package, a
trust-all certificate handler, an exported component, a body-logging interceptor.
Those are real and fixable. The second is "we trusted the client to tell us the
truth", and the fix is never in the app: it is a backend that verifies an attestation,
issues a scoped short-lived token, and authorizes each request on its own.
Cross-platform stacks deserve their own suspicion. React Native and Flutter move the code, not the boundary — the bundle and the AOT binary are both inside the package, and a storage plugin may or may not reach the hardware-backed store depending on platform and configuration. Check what the plugin actually does rather than what its name suggests.
References
references/verifying-findings.md— confirm or refute a finding, then lock itreferences/platform-specifics.md— manifest attributes and accessibility classes, pinning configuration per stack, App Link and Universal Link setup, screen-capture APIs, and what React Native and Flutter storage plugins actually usechecklists/android_manifest.yamlchecklists/ios_keychain_ats.yaml- OWASP MASVS v2.0 · MASTG.
- CWE-919 — Weaknesses in Mobile Applications.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

