Skip to content

Add an Android counterpart to MASTG-TEST-0211 for broken hashing algorithms #3933

Open

Description

@phplego

Description

The MASTG v2 Android test set appears to be missing an atomic test for the use of broken hashing algorithms, equivalent to the iOS MASTG-TEST-0211: Broken Hashing Algorithms.

For example, the current Android v2 tests do not appear to detect security-sensitive uses such as:

MessageDigest.getInstance("MD5");
MessageDigest.getInstance("SHA-1");

Background

The deprecated Android MASTG-TEST-0014 had a broad scope. It instructed testers to identify cryptographic primitives including MessageDigest and to verify them against the guidance for insecure and deprecated algorithms.

Issue #2949 was created to port MASTG-TEST-0014 from v1 to v2.

An initial attempt in #3064 decomposed the broad v1 test into multiple atomic tests and included a draft named Weak Hashing Algorithms. However, that PR remains an open draft and the hashing test was not merged.

Later, #3551 ported only the explicit security-provider portion of MASTG-TEST-0014. It introduced MASTG-TEST-0312 and closed #2949.

MASTG-TEST-0312 checks whether an app explicitly supplies a JCA security provider. It does not evaluate the selected hashing algorithm. Consequently, a call such as MessageDigest.getInstance("MD5") uses the default provider and is outside its scope.

The old MASTG-TEST-0014 is now marked as deprecated and covered by MASTG-TEST-0312, although the latter covers only the provider-related portion of the old test. This seems to have left the broken-hashing portion without a corresponding Android v2 test or a separate tracking issue.

Proposed test

Add an atomic Android MASVS-CRYPTO test equivalent in purpose to MASTG-TEST-0211. It should:

  • identify hashing APIs such as java.security.MessageDigest.getInstance;
  • explicitly cover broken algorithms such as MD5 and SHA-1, including their common JCA aliases;
  • consider third-party and native cryptographic implementations where applicable;
  • require contextual validation to distinguish security-sensitive hashing from non-security uses such as ordinary checksums;
  • map to the same applicable weakness as the iOS counterpart;
  • include a demo and/or static-analysis rule if appropriate.

The metadata of MASTG-TEST-0014 could also be updated to indicate partial coverage or to reference both MASTG-TEST-0312 and the new hashing test.

Related items

Activity

  1. jankesec commented on Sep 4, 2026

    @jankesec

    I'd like to work on this. Could you assign me?

  2. github-actions commented on Sep 4, 2026

    @github-actions

    Hi @jankesec, thanks for your interest in contributing to OWASP MASTG.

    Before we can assign you to this issue, please confirm that you have read and understand our contribution guidelines.

    See https://github.com/OWASP/mastg/blob/master/.github/PULL_REQUEST_TEMPLATE.md and all linked documents.

    To confirm, please reply with the following message, copy paste it exactly.

    I have read the contribution guidelines and the PR template and I confirm that I will follow them.
    
  3. jankesec commented on Sep 4, 2026

    @jankesec

    I have read the contribution guidelines and the PR template and I confirm that I will follow them.

  4. github-actions commented on Sep 4, 2026

    @github-actions

    Thank you @jankesec for accepting the contribution guidelines.

    Your assignment request has been noted and labeled, a maintainer will review and assign you to this issue shortly, please refrain from making a pull request until you have been officially assigned.

  5. added a commit that references this issue on Sep 4, 2026
    0d1df84
  6. jankesec commented on Sep 4, 2026

    @jankesec

    The Android test and demo for this issue are ready in #3952. The assignment bot closed the PR until I am assigned. Please assign me when you have a chance and I will reopen it.

  7. cpholguera commented on Sep 5, 2026

    @cpholguera
    Collaborator

    Thank you @jankesec. Assigned and reopened PR. We'll take a look as soon as someone's available for reviewing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions