Description

In the Android application ai.nreal.nebula.universal version 3.2.1, a hardcoded AES key and IV were discovered in ai/nreal/nebula/flutterPlugin/CloudStoragePlugin.java. Attackers can extract these keys to decrypt cloud storage temporary credentials, which may lead to user cloud file leakage.

Proof of Concept

In ai/nreal/nebula/flutterPlugin/CloudStoragePlugin.java

1.Hardcoded Key and IV:

image.png

2.Usage in Encryption (within getCredential method):

String encrypt = AESUtils.encrypt("{\\"code\\":\\"" + str + "\\"}", AES_KEY, AES_IV);
HashMap hashMap = new HashMap();
hashMap.put("data", encrypt);
this.methodChannel.invokeMethod(FLUTTER_METHOD_GET_CREDENTIAL, hashMap, ...);

3.Usage in Decryption (inside the MethodChannel.Result callback):

String str3 = new String(AesUtil.decryptFormBase64(str2, CloudStoragePlugin.AES_KEY));
StsCredentialBean stsCredentialBean = (StsCredentialBean) new Gson().fromJson(str3, StsCredentialBean.class);

The decrypted data contains temporary AWS credentials (accessKeysecretAccessKeysecurityToken) which are then used to initialize cloud storage services and upload files.

Mitigation

Remove the hardcoded AES key and IV from the source code, and use Android Keystore or a backend proxy to securely manage cryptographic secrets.

Impact

An attacker who extracts the hardcoded AES key and IV can:

References