Anti-AIClone

Log date · Mon

Can MobSF detect every secret in your app?

No. MobSF 4.5.2 detects known formats, but our comparison shows why a missed match does not prove an app contains no secrets.

Can MobSF find every secret?

No. MobSF 4.5.2 added detection of known secret formats in Android and iOS string analysis, but an empty result does not prove an app has no secrets. [1] In our own comparison, two programs printed the same fake credential at runtime, while an exact literal search matched only the plain class file.

Results at a glance
QuestionResult
What did the release add?Known secret format detection in Android and iOS string analysis.
What did the samples print?The same fake credential in both cases.
How many exact matches?One of two class files.
Does an empty result mean safe?No; coverage and representation affect the result.

Released at 06:20 UTC on 2026-08-10, v4.5.2 lists formats including GitHub, Slack, Stripe and OpenAI tokens and PEM keys. [1] A finding starts an investigation: identify the asset and its permissions before acting. Public identifiers and test data can also need human classification.

How we compared two representations

MobSF was unavailable on this machine. We compiled two Java programs we wrote with OpenJDK 17.0.19, searched their class files with grep and inspected constants and instructions with javap. This illustrates a limitation of string inspection; it is not a test of MobSF 4.5.2, an APK or an IPA, and does not measure its detection rate.

Plain stores the whole placeholder; Encoded stores its Base64 representation and decodes it at runtime. The value is visibly fictitious and belongs to no service. We kept the search target and compiler environment fixed and changed the stored representation.

Runtime and exact-match output, copied from the transcript.
== runtime ==
DEMO-KEY-not-a-real-credential-0000
DEMO-KEY-not-a-real-credential-0000
== exact literal check ==
Plain.class: present
Encoded.class: absent

This is not a comparison of scanner rules: our search looks for one complete known value, whereas the MobSF release describes known-format rules. Compilers and packaging also change artifact contents, so the ratio here cannot be generalized to real apps.

What the result means

The javap -constants option displays static final constants, -c disassembles instructions and -private includes private members. [3] The output below shows the literal in the first file; the second stores an encoded string and calls the Base64 decoder.

Excerpt from javap output.
  static final java.lang.String VALUE = "DEMO-KEY-not-a-real-credential-0000";
  static final java.lang.String VALUE = "REVNTy1LRVktbm90LWEtcmVhbC1jcmVkZW50aWFsLTAwMDA=";
       7: invokestatic  #15                 // Method java/util/Base64.getDecoder:()Ljava/util/Base64$Decoder;
      12: invokevirtual #25                 // Method java/util/Base64$Decoder.decode:(Ljava/lang/String;)[B

Base64 changes the representation, not the credential’s privileges. The program can still obtain the original value, so a missed exact match is not evidence of protection. Conversely, appearance alone cannot establish whether a match is active, what privileges it has, or whether it is a production credential.

Android’s documentation explains that hardcoded cryptographic secrets can be extracted from app files and discusses KeyChain and Android Keystore for their respective uses. [2] Managing a device key is a different problem from embedding the same privileged server credential in every client.

Recommendations for each finding

These are engineering recommendations, not effects measured in our experiment. Verify ownership, privileges and usage through a controlled channel first; do not copy the discovered value into a public ticket.

Recommendations after classification
CaseRecommendation
Real shared server secretRestrict and rotate it, verify the old value fails, and keep the replacement on the server.
Device private keyConsider a platform keystore and usage restrictions; test recovery and migration.
Public key or public identifierRecord its purpose and rationale; do not classify it as a secret.
Unknown or suspected test valueAsk its owner to verify environment and privileges before deciding.

A backend proxy still needs authentication, rate limits and authorization; moving a call to a server does not automatically prevent abuse. During rotation, inventory older releases and dependants, monitor migration, and verify that the old credential actually stops working after revocation. Reports and build artifacts can contain sensitive values, so restrict access and retention.

Check your own release build

Reproduce the sample first, then establish a scanning baseline for a release build you are authorized to inspect. When running MobSF, record its version, the build identifier, whether the scan completed and its coverage; associate the report with that build. A failed check, no finding and a verified safe outcome are different states. Do not treat a tool error as a pass.

Run in the sample directory; output can contain strings.
javac Plain.java Encoded.java
java Plain
java Encoded
javap -c -constants -private Plain
javap -c -constants -private Encoded

For your own Java build, replace the class path or name with the actual one and inspect known locations with javap; APK and IPA review should also cover resources, dependencies and packaging configuration. Do not put real credentials on command lines or in shared logs. Use a safe test placeholder to verify the check can find expected content, and retain a known negative sample to catch silent rule or pipeline failures.

Review shipped versions too, and handle confirmed exposed secrets according to their privileges and risk. After changing source, generate and inspect a new release build and verify revocation of the old credential; removing a value from source does not change files already distributed.

Your checklist

  • Record scanner version, build identifier and coverage.
  • Verify the pipeline with a test placeholder.
  • Check each finding’s purpose, privileges and validity.
  • Rotate exposed real secrets and verify revocation.
  • Recheck new release builds and shipped versions.

Primary sources

All sources and reproduction status ↗