You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sensitive information, such as cryptographic keys, should never be written to log files to avoid potential disclosure.
Description
Log files are generally considered to be less protected than most security-critical assets in an application. Therefore, unless a sufficient level of protection on log files is actively maintained, it is best practice to avoid logging any sensitive information to log files. Even if constrained to specific instances, such as debug configurations, there remains a risk of a user or maintainer accidentally using a build with a debug flag active.
Within the SQL KeyStore, the write_encryption_epoch_key_pairs() function is used to write the HPKE keys for the epoch to the store:
As highlighted, the value epoch contains the EpochKey and the array key_pairs contains HPKE key pairs. Both of these cryptographic secrets are serialized and used in the computation key and value, both of which are logged using tracing::debug(). This behavior is inconsistent with other functions in the file (and the rest of the codebase), which suggests that the highlighted log messages may be unintentional or a remnant from the development process instead of necessary debug information.
To avoid potential leakage of the epoch key or HPKE keys via debug logs, it is recommended to remove or sanitize the above log statements such that they are safe to be made public.
Recommendation
Remove the key and value log outputs in write_encryption_epoch_key_pairs().
Location
xmtp_mls/src/storage/sql_key_store.rs
The text was updated successfully, but these errors were encountered:
Impact
Sensitive information, such as cryptographic keys, should never be written to log files to avoid potential disclosure.
Description
Log files are generally considered to be less protected than most security-critical assets in an application. Therefore, unless a sufficient level of protection on log files is actively maintained, it is best practice to avoid logging any sensitive information to log files. Even if constrained to specific instances, such as debug configurations, there remains a risk of a user or maintainer accidentally using a build with a debug flag active.
Within the SQL KeyStore, the
write_encryption_epoch_key_pairs()
function is used to write the HPKE keys for the epoch to the store:Figure 17: xmtp_mls/src/storage/sql_key_store.rs
As highlighted, the value epoch contains the EpochKey and the array key_pairs contains HPKE key pairs. Both of these cryptographic secrets are serialized and used in the computation key and value, both of which are logged using tracing::debug(). This behavior is inconsistent with other functions in the file (and the rest of the codebase), which suggests that the highlighted log messages may be unintentional or a remnant from the development process instead of necessary debug information.
To avoid potential leakage of the epoch key or HPKE keys via debug logs, it is recommended to remove or sanitize the above log statements such that they are safe to be made public.
Recommendation
Remove the key and value log outputs in write_encryption_epoch_key_pairs().
Location
xmtp_mls/src/storage/sql_key_store.rs
The text was updated successfully, but these errors were encountered: