Back to all reviewers

Use specialized sensitive types

duckdb/duckdb
Based on 2 comments
Other

When handling sensitive data like encryption keys, choose data types based on the data's lifecycle and security requirements. Use specialized types (e.g., `EncryptionKey`) for actual sensitive data that persists in memory, as these provide memory locking and secure deletion. Use regular strings only for temporary user input that gets immediately processed...

Security Other

Reviewer Prompt

When handling sensitive data like encryption keys, choose data types based on the data’s lifecycle and security requirements. Use specialized types (e.g., EncryptionKey) for actual sensitive data that persists in memory, as these provide memory locking and secure deletion. Use regular strings only for temporary user input that gets immediately processed and wiped.

For example:

// For temporary user input (acceptable)
string encryption_key;  // User input, immediately wiped

// For actual encryption keys (preferred)
EncryptionKey actual_key;  // Locked memory, secure deletion

The distinction matters because temporary user input can be any length and exists briefly, while actual keys should be fixed-size, memory-locked, and securely managed throughout their lifecycle.

2
Comments Analyzed
Other
Primary Language
Security
Category

Source Discussions