- Description: If Realm database encryption is not enabled, an attacker gaining physical or logical access to the device can directly access and read the entire database file. They can use tools like Realm Studio or the Realm SDK itself to open and inspect the database contents, bypassing application security measures.
- Impact: Critical Data Confidentiality Breach. Complete disclosure of all sensitive data stored within the Realm database, including user credentials, personal information, financial data, and application secrets.
- Realm Cocoa Component Affected: Realm Core (Storage Engine), Realm File, Encryption Feature (or lack thereof)
- Risk Severity: Critical (if sensitive data is stored)
- Mitigation Strategies:
- Mandatory Realm Database Encryption: Always enable Realm database encryption using
Realm.Configuration.encryptionKey
for applications storing sensitive data. - Strong Device Security: Encourage and enforce strong device passwords/PINs and full device encryption to protect against physical access.
- Minimize Sensitive Data Storage: Reduce the amount of highly sensitive data stored in Realm if possible, or consider application-level encryption for extremely critical fields in addition to Realm encryption.
- Mandatory Realm Database Encryption: Always enable Realm database encryption using
- Description: Even with Realm database encryption enabled, if the encryption key is weak, easily guessable, or stored insecurely, an attacker can potentially recover the key through reverse engineering, static analysis of the application, or by exploiting vulnerabilities in key storage mechanisms. Once the key is obtained, they can decrypt the Realm database.
- Impact: Critical Data Confidentiality Breach. Circumvention of Realm database encryption, leading to complete disclosure of sensitive data.
- Realm Cocoa Component Affected: Realm Configuration, Encryption Feature, Key Management Implementation
- Risk Severity: Critical
- Mitigation Strategies:
- Strong, Randomly Generated Encryption Keys: Generate encryption keys using cryptographically secure random number generators. Avoid using predictable or easily guessable keys.
- Secure Key Storage using Platform APIs: Store encryption keys exclusively in platform-provided secure storage mechanisms like Keychain (iOS/macOS) or Keystore (Android). Never hardcode keys in application code or store them in easily accessible files or shared preferences.
- Regular Security Audits: Conduct security audits and penetration testing to identify potential weaknesses in key management implementation.
- Key Rotation (Consideration for High-Security Applications): Implement key rotation strategies to periodically change encryption keys, reducing the window of opportunity if a key is compromised.
- Description: Security vulnerabilities may be discovered in the Realm Cocoa library itself. These vulnerabilities could be in core components responsible for data parsing, query processing, data synchronization, or other functionalities. Exploiting these vulnerabilities could lead to various severe impacts, including data corruption, application crashes, denial of service, or potentially even remote code execution (though less likely in mobile context, but still a possibility).
- Impact: High to Critical - Data Integrity Breach, Data Availability Impact, Potential Security Breach. Depending on the nature of the vulnerability, impacts can range from data corruption and application instability (High) to potential remote code execution or significant data breaches (Critical).
- Realm Cocoa Component Affected: Realm Cocoa Library (Core, API, Bindings, Synchronization features if used)
- Risk Severity: High to Critical (depending on the specific vulnerability)
- Mitigation Strategies:
- Proactive Realm Cocoa Library Updates: Establish a process for promptly updating the Realm Cocoa library to the latest stable version as soon as updates are released. This ensures timely patching of known vulnerabilities.
- Vigilant Security Monitoring: Subscribe to Realm security advisories, security mailing lists, and monitor relevant security news sources to stay informed about reported vulnerabilities in Realm Cocoa and related dependencies.
- Dependency Management and Security Scanning: Utilize robust dependency management tools and integrate security scanning into the development pipeline to automatically detect and flag vulnerable versions of Realm Cocoa and its dependencies.
- Security Testing and Penetration Testing: Include Realm Cocoa specific security considerations in application security testing and penetration testing efforts to identify potential vulnerabilities in the application's interaction with the library and any exploitable weaknesses.