android-intent-security

Hardens Android components against Intent redirection and unauthorized access vulnerabilities.

Updated Aug 14, 2026
One-click install
npx skills add https://github.com/tvh25082004/Badminton --skill android-intent-security-tvh25082004
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: android-intent-security
Source: https://github.com/tvh25082004/Badminton/tree/main/.claude/skills/android/android-intent-security
Command: npx skills add https://github.com/tvh25082004/Badminton --skill android-intent-security-tvh25082004

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires androidx.core:core:1.9.0.

What problem does it solve? Android apps that handle incoming Intents, PendingIntents, and exported components are vulnerable to Intent redirection, component hijacking, and unauthorized data access. This Skill provides concrete patterns to audit and secure Activities, Services, Broadcast Receivers, and ContentProviders. ## Core Features & Use Cases - Safe Intent Redirection: Validate nested Intents manually or with AndroidX IntentSanitizer before launching, blocking cross-app redirection and URI permission abuse. - PendingIntent Hardening: Enforce FLAG_IMMUTABLE by default and require explicit target components for mutable PendingIntents. - Component Protection: Apply signature-level permissions, exported flags, and runtime caller signature verification for Services and ContentProviders. - Use Case: While auditing an AndroidManifest.xml, you find an exported activity that forwards a nested Intent extra. Use this Skill to replace the unsafe launch with an IntentSanitizer allowlist and generate a structured security alignment report. ## Quick Start Audit my AndroidManifest.xml and the intent-handling code in MainActivity.kt for Intent redirection vulnerabilities and apply the recommended fixes.

Frequently Asked Questions about android-intent-security

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent Intent redirection in Android?▼

Validate any nested Intent before launching it: check that its target package matches your app and that the target component is exported. With AndroidX Core 1.9.0+, use IntentSanitizer with an explicit allowlist of components, actions, and extras, calling sanitizeByThrowing or sanitizeByFiltering.

Should I use FLAG_IMMUTABLE or FLAG_MUTABLE for PendingIntent?▼

Use PendingIntent.FLAG_IMMUTABLE by default for alarms and notifications so receivers cannot alter the Intent. Only use FLAG_MUTABLE for cases like inline notification replies, and always set an explicit target component on the base Intent to prevent hijacking.

How do I secure an exported Android Service from untrusted callers?▼

Retrieve the calling UID with Binder.getCallingUid(), resolve it via PackageManager.getPackagesForUid(), and verify the caller's signing certificate with hasSigningCertificate. Perform this check inside each Binder transaction method, not in onBind, since Android caches binder connections.

Does IntentSanitizer work on older Android versions?▼

IntentSanitizer requires AndroidX Core 1.9.0 or higher and works at the library level, but the Skill targets a minimum of API 23. If the library is unavailable, fall back to manual verification of the nested Intent's target package and exported status.

What are the limitations of this Android Intent security guidance?▼

It covers only local inter-component and inter-app communication security on the Android platform. It does not address network security, web integration, or host-to-server security, so those areas require separate hardening guidance.