Aalexbit-codemod

java-android-intent-redirection-mining

Mine Android component launches fed by externally supplied Intents that may enable intent redirection (javasecurity:S6384); read-only metrics for security review

miningmetricsjavasecurityvulnerabilityandroidintentredirectioncwe-20
Public
0 executions

Run locally

npx codemod java-android-intent-redirection-mining

java-android-intent-redirection-mining

Read-only mining codemod for SonarSource rule javasecurity:S6384Components should not be vulnerable to intent redirection.

It scans Java source and emits metrics only; it never modifies code (return null).
Findings are high-signal review candidates surfaced by AST pattern matching — they are
not proven vulnerabilities. A static mining pass cannot prove an end-to-end taint flow
from an untrusted source to the sink, so confirm data flow before remediating.

FieldValue
Rule keyjavasecurity:S6384
TypeVulnerability
SeverityBlocker
Primary CWECWE-20 (Improper Input Validation)
Tagsandroid

What it detects

Android component launches whose Intent comes from an externally supplied value rather than a freshly constructed explicit Intent.

Sinks:

  • startActivity / startActivityForResult / startActivities / startService / startForegroundService / bindService / sendBroadcast / sendOrderedBroadcast / setResult

Emission rule: Emits only when the Intent argument is a variable, field, or method-call result (e.g. from getParcelableExtra). Freshly constructed new Intent(...) launches are skipped.

Metric: java-android-intent-redirection-mining

dimensionmeaning
ruleSonarSource rule key
cweprimary CWE identifier
severityalways blocker
sinkthe detected sink (method/constructor)
package_nameenclosing Java package
class_nameenclosing class/interface/enum/record
method_nameenclosing method/constructor (or <none>)
filefile path (relative to scan target)
line1-based line of the finding
arg_kindclassification of the relevant argument (literal, concatenation, variable, method_call, field, object_creation, expression, none)

Security standards

  • CWE-20 (Improper Input Validation)
  • MASVS 1: MSTG-PLATFORM-2
  • OWASP ASVS 4.0: 5.1.3, 5.1.4
  • OWASP Mobile Top 10 2024: M4
  • STIG ASD V5R3: V-222609

Run locally

bash

Part of the java-security-blocker-mining suite covering 19 blocker-severity
Java vulnerability rules. Each codemod is read-only and emits a single named metric.

Ready to contribute?

Build your own codemod and share it with the community.