mobsf.mobsfscan.android.secrets.hardcoded_username

profile photo of MobSFMobSF
Author
unknown
Download Count*
License

A hardcoded username in plain text is identified.

Run Locally

Run in CI

Defintion

rules:
  - id: hardcoded_username
    patterns:
      - pattern-not: $X = "";
      - pattern-not: $M($X, "", ...);
      - pattern-either:
          - pattern: |
              $X = "...";
          - pattern: |
              $M($X, "...", ...);
      - metavariable-regex:
          metavariable: $X
          regex: (?i:^.{0,100}user.{0,100})
    message: A hardcoded username in plain text is identified.
    languages:
      - java
    severity: WARNING
    metadata:
      cwe: cwe-798
      owasp-mobile: m9
      masvs: storage-14
      reference: https://github.com/MobSF/owasp-mstg/blob/master/Document/0x05d-Testing-Data-Storage.md#storing-a-key---example
      license: LGPL-3.0-or-later
      vulnerability_class:
        - Other