SCWE-025: Improper Cryptographic Key Management
Stable Version v1.0
This content is in the version-(v1.0) and still under active development, so it is subject to change any time (e.g. structure, IDs, content, URLs, etc.).
Relationships¶
- CWE-310: Cryptographic Issues
CWE-310 Link
Description¶
Improper cryptographic key management refers to the failure to securely generate, store, or use cryptographic keys. This can lead to: - Unauthorized access to sensitive data. - Exploitation of the contract's logic. - Loss of funds or data.
Remediation¶
- Use secure key management: Leverage secure key management systems or libraries.
- Avoid hardcoding keys: Never hardcode cryptographic keys in the contract.
- Regularly rotate keys: Periodically update cryptographic keys to reduce risks.
Examples¶
-
Improper Key Management
-
Proper Key Management