Skip to content

Security Vulnerability: AssetCryptImpl Uses Insecure Encryption Configurationย #14315

@cmtanko

Description

@cmtanko

Summary

The AssetCryptImpl.java template in Titanium SDK uses AES-CBC encryption without integrity checking, making it vulnerable to padding oracle attacks. This affects all Android applications built with Titanium SDK that use asset encryption.

Affected File

android/templates/build/AssetCryptImpl.java

Current implementation:

Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
cipher.init(Cipher.DECRYPT_MODE, 
    new SecretKeySpec(ti.cloak.Binding.getKey(salt), "AES"), 
    new IvParameterSpec(salt));

Vulnerability Details

CWE Classification

  • CWE-649: Reliance on Obfuscation or Encryption of Security-Relevant Inputs without Integrity Checking
  • OWASP Mobile Top 10: M5 - Insufficient Cryptography
  • OWASP MASVS: MSTG-CRYPTO-3

Security Issues

  1. CBC Mode Without HMAC/Integrity Checking

    • CBC mode with PKCS5/PKCS7 padding is vulnerable to padding oracle attacks
    • Without integrity checking (HMAC), attackers can manipulate ciphertext and use decryption error responses to decrypt data byte-by-byte
    • No authentication means tampering cannot be detected
  2. IV Reuse and Predictability

    • The initialization vector (IV) is derived from the salt, not randomly generated
    • The same salt is used as both the IV and for key derivation
    • IVs must be unique and unpredictable for each encryption operation in CBC mode
    • Reusing IVs with the same key compromises security
  3. Same Value Used as Salt and IV

    • Cryptographic best practice requires separate, distinct values for key derivation salt and encryption IV
    • Using the same value for both purposes weakens the overall security

Impact

Severity: High

An attacker with access to an APK file could:

  • Extract and decrypt JavaScript assets through padding oracle attacks
  • Reverse engineer application logic and business rules
  • Extract hardcoded API keys, endpoints, or other sensitive information from the JavaScript code
  • Modify and re-encrypt assets (if they can re-sign the APK)

Environment

  • Titanium SDK Version: 12.8.0.GA (and likely all prior versions)
  • Platform: Android
  • Build Type: Production/Distribution builds with asset encryption enabled

Discovered By

Security assessment of production Android application built with Titanium SDK 12.8.0.GA

Metadata

Metadata

Assignees

No one assigned

    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