Skip to content

MAS-L2 - Advanced Security

How to proceed when no MASTG TEST exists

The MASTG does not yet provide dedicated tests for every MASWE. Defining a weakness and defining a reliable, reproducible way to test for it are different tasks, and some areas require extensive research, validation, or refinement before they can be captured as formal MASTG TESTs. The guide also evolves continuously as platforms, frameworks, and testing techniques change.

Even when no dedicated MASTG TEST exists, you can still assess the weakness.

  1. Start with the MASWE: Review its "Modes of Introduction" to understand the concrete conditions that may introduce the weakness and what should be tested.

  2. Check related MASTG content: Look at similar or related existing MASTG TESTs, as they can provide useful testing patterns, structure, and inspiration for designing a new test. Also consult relevant MASTG KNOW, TECH, and TOOL entries, together with the official mobile platform documentation, to understand the topic and identify suitable testing techniques.

  3. Contribute back: If you develop a reliable testing procedure, consider contributing a new MASTG TEST and a MASTG DEMO so others can reuse it.

MAS-L2 extends MAS-L1, introducing additional security measures and best practices for mobile apps to address advanced threats requiring more rigorous threat modeling and testing strategies.

It assumes that:

  • the security controls of the mobile operating system cannot be trusted (e.g. the device is rooted/jailbroken).
  • the primary user of the device is not viewed as an adversary.
  • other applications installed on the device are viewed as an adversary.
  • a third party with or without physical access is viewed as an adversary.

MAS-L2 is recommended for

  • apps that handle high-risk sensitive data and contain sensitive functionality

For example:

Requirements

Requirement MASWE ID Platform MASVS ID Tests Status
The app encrypts sensitive data stored in private storage. MASWE-0001: Sensitive Data Stored Unencrypted in Private Storage platform:android platform:ios MASVS-STORAGE-1masvs-storage-1 11 currentstatus:current
The app encrypts sensitive data stored outside of private storage. MASWE-0002: Sensitive Data Stored Unencrypted Outside of Private Storage platform:android platform:ios MASVS-STORAGE-1masvs-storage-1 4 currentstatus:current
The app stores cryptographic keys inside the platform-provided secure keystore. MASWE-0003: Cryptographic Keys Stored Outside of Platform Keystore platform:android platform:ios MASVS-STORAGE-1masvs-storage-1 3 currentstatus:current
The app does not hardcode sensitive data in the application package. MASWE-0004: Sensitive Data Hardcoded in the App Package platform:android platform:ios MASVS-STORAGE-1masvs-storage-1 0 currentstatus:current
The app excludes sensitive data from application logs. MASWE-0005: Insertion of Sensitive Data into Logs platform:android platform:ios MASVS-STORAGE-2masvs-storage-2 4 currentstatus:current
The app excludes sensitive data from backups. MASWE-0006: Sensitive Data Not Excluded From Backup platform:android platform:ios MASVS-STORAGE-2masvs-storage-2 4 currentstatus:current
The app properly encrypts sensitive data. MASWE-0007: Improper Encryption platform:android platform:ios MASVS-CRYPTO-1masvs-crypto-1 10 currentstatus:current
The app properly hashes sensitive data. MASWE-0008: Improper Hashing platform:android platform:ios MASVS-CRYPTO-1masvs-crypto-1 1 currentstatus:current
The app properly uses Message Authentication Codes (MACs). MASWE-0009: Improper Use of Message Authentication Code (MAC) platform:android platform:ios MASVS-CRYPTO-1masvs-crypto-1 0 currentstatus:current
The app properly generates cryptographic signatures. MASWE-0010: Improper Generation of Cryptographic Signatures platform:android platform:ios MASVS-CRYPTO-1masvs-crypto-1 0 currentstatus:current
The app properly verifies cryptographic signatures. MASWE-0011: Improper Verification of Cryptographic Signature platform:android platform:ios MASVS-CRYPTO-1masvs-crypto-1 0 currentstatus:current
The app properly generates random numbers. MASWE-0012: Improper Random Number Generation platform:android platform:ios MASVS-CRYPTO-1masvs-crypto-1 4 currentstatus:current
The app securely generates cryptographic keys. MASWE-0013: Improper Cryptographic Key Generation platform:android platform:ios MASVS-CRYPTO-2masvs-crypto-2 2 currentstatus:current
The app derives cryptographic keys using approved key derivation functions. MASWE-0014: Improper Cryptographic Key Derivation platform:android platform:ios MASVS-CRYPTO-2masvs-crypto-2 0 currentstatus:current
The app rotates cryptographic keys regularly. MASWE-0015: Cryptographic Key Rotation Not Implemented platform:android platform:ios MASVS-CRYPTO-2masvs-crypto-2 0 currentstatus:current
The app restricts access to cryptographic keys. MASWE-0016: Cryptographic Key Access Not Restricted platform:android platform:ios MASVS-CRYPTO-2masvs-crypto-2 0 currentstatus:current
The app verifies that the device has a secure lock configured. MASWE-0017: Device Secure Lock Not Enforced platform:android platform:ios MASVS-CRYPTO-2masvs-crypto-2 4 currentstatus:current
The app enforces authentication and authorization on its components. MASWE-0018: Lack of Authentication or Authorization on App Components platform:android platform:ios MASVS-AUTH-1masvs-auth-1 6 currentstatus:current
The app enables auto-fill support for credential providers. MASWE-0019: Lack of Auto-fill Support for Credential Providers platform:android platform:ios MASVS-AUTH-1masvs-auth-1 0 currentstatus:current
The app implements local authentication securely. MASWE-0020: Local Authentication Can Be Bypassed platform:android platform:ios MASVS-AUTH-2masvs-auth-2 5 currentstatus:current
The app does not allow fallback to non-biometric credentials for sensitive transactions. MASWE-0021: Fallback to Non-biometric Credentials Allowed for Sensitive Transactions platform:android platform:ios MASVS-AUTH-2masvs-auth-2 3 currentstatus:current
The app invalidates keys after any enrollment of new biometric data. MASWE-0022: Crypto Keys Not Invalidated on New Biometric Enrollment platform:android platform:ios MASVS-AUTH-2masvs-auth-2 3 currentstatus:current
The app enforces step-up authentication before granting access to sensitive functionality. MASWE-0023: Step-Up Authentication Not Implemented for Sensitive Actions platform:android platform:ios MASVS-AUTH-3masvs-auth-3 0 currentstatus:current
The app makes sensitive data inaccessible after session termination. MASWE-0024: Sensitive Data Accessible After Session Termination platform:android platform:ios MASVS-AUTH-3masvs-auth-3 0 currentstatus:current
The app ensures non-repudiation for critical actions. MASWE-0025: Lack of Non-Repudiation for Critical Actions platform:android platform:ios MASVS-AUTH-3masvs-auth-3 0 currentstatus:current
The app encrypts all network traffic. MASWE-0026: Network Traffic Not Encrypted platform:android platform:ios MASVS-NETWORK-1masvs-network-1 16 currentstatus:current
The app validates certificates for all network traffic. MASWE-0027: Insecure Certificate Validation platform:android platform:ios MASVS-NETWORK-1masvs-network-1 9 currentstatus:current
The app correctly implements identity pinning. MASWE-0028: Insecure Identity Pinning platform:android platform:ios MASVS-NETWORK-2masvs-network-2 4 currentstatus:current
The app securely handles deep links. MASWE-0029: Insecure Deep Links platform:android platform:ios MASVS-PLATFORM-1masvs-platform-1 5 currentstatus:current
The app uses the clipboard securely and only with user consent. MASWE-0030: Improper Use of the Clipboard platform:android platform:ios MASVS-PLATFORM-1masvs-platform-1 0 currentstatus:current
The app only permits trusted app extensions to interact with it. MASWE-0031: Allowing Untrusted App Extensions platform:ios MASVS-PLATFORM-1masvs-platform-1 1 currentstatus:current
The app securely handles intents. MASWE-0032: Insecure Intents platform:android MASVS-PLATFORM-1masvs-platform-1 3 currentstatus:current
The app does not expose sensitive native functionality to WebView content. MASWE-0033: Sensitive Native Functionality Exposed in WebViews platform:android platform:ios MASVS-PLATFORM-2masvs-platform-2 0 currentstatus:current
The app only allows trusted WebView content to access local resources. MASWE-0034: WebViews Allow Access to Local Resources with Untrusted Content platform:android platform:ios MASVS-PLATFORM-2masvs-platform-2 13 currentstatus:current
The app only allows trusted content in WebViews. MASWE-0035: WebViews Loading Untrusted Content platform:android platform:ios MASVS-PLATFORM-2masvs-platform-2 5 currentstatus:current
The app does not unnecessarily expose sensitive data through its user interface. MASWE-0036: Unnecessary Exposure of Sensitive Data via the User Interface platform:android platform:ios MASVS-PLATFORM-3masvs-platform-3 12 currentstatus:current
The app does not unnecessarily expose sensitive data through system notifications. MASWE-0037: Unnecessary Exposure of Sensitive Data via Notifications platform:android platform:ios MASVS-PLATFORM-3masvs-platform-3 1 currentstatus:current
The app removes or masks sensitive data from its views when moved to the background, when being recorded or when a screenshot is taken. MASWE-0038: Insufficient Protection of Sensitive Data from Screenshots or Screen Recordings platform:android platform:ios MASVS-PLATFORM-3masvs-platform-3 6 currentstatus:current
The app protects its sensitive screens against overlay attacks. MASWE-0039: App Vulnerable to Overlay Attacks platform:android platform:ios MASVS-PLATFORM-3masvs-platform-3 0 currentstatus:current
The app prevents sensitive data from being exposed to, or captured by, accessibility services. MASWE-0040: Sensitive Data Leaked via Accessibility Services platform:android platform:ios MASVS-PLATFORM-3masvs-platform-3 1 currentstatus:current
The app detects if it is running on an unsupported OS version and reacts appropriately. MASWE-0041: Running on a Recent Platform Version Not Ensured platform:android platform:ios MASVS-CODE-1masvs-code-1 1 currentstatus:current
The app targets the latest platform version. MASWE-0042: Latest Platform Version Not Targeted platform:android platform:ios MASVS-CODE-1masvs-code-1 0 currentstatus:current
The app detects if it must be updated and reacts appropriately. MASWE-0043: Enforced Updating Not Implemented platform:android platform:ios MASVS-CODE-2masvs-code-2 4 currentstatus:current
The app's third-party components are regularly checked for known vulnerabilities. MASWE-0044: Dependencies with Known Vulnerabilities platform:android platform:ios MASVS-CODE-3masvs-code-3 4 currentstatus:current
The app uses the compiler-provided security features of the platform. MASWE-0045: Compiler-Provided Security Features Not Used platform:android platform:ios MASVS-CODE-3masvs-code-3 5 currentstatus:current
The app does not use deprecated APIs or functionality. MASWE-0046: Use of Deprecated APIs or Functionality platform:android platform:ios MASVS-CODE-3masvs-code-3 0 currentstatus:current
The app uses standard APIs for security-critical functionality. MASWE-0047: Using Non-Standard APIs for Security-Critical Functionality platform:android platform:ios MASVS-CODE-3masvs-code-3 0 currentstatus:current
The app package does not contain malicious code. MASWE-0048: Malicious Code Included in the App platform:android platform:ios MASVS-CODE-3masvs-code-3 0 currentstatus:current
The app loads dynamic code safely from trusted sources. MASWE-0049: Unsafe Dynamic Code Loading platform:android platform:ios MASVS-CODE-4masvs-code-4 0 currentstatus:current
The app securely handles untrusted data. MASWE-0050: Unsafe Handling of Untrusted Data platform:android platform:ios MASVS-CODE-4masvs-code-4 4 currentstatus:current