Skip to content

Redact encryption master key from config validation error messages#239

Merged
lgomezma merged 1 commit into
masterfrom
security/redact-encryption-master-key-in-errors
Jun 4, 2026
Merged

Redact encryption master key from config validation error messages#239
lgomezma merged 1 commit into
masterfrom
security/redact-encryption-master-key-in-errors

Conversation

@lgomezma
Copy link
Copy Markdown
Contributor

@lgomezma lgomezma commented Jun 4, 2026

Summary

The two key-length validation checks in lib/config.js interpolate the full encryptionMasterKey / encryptionMasterKeyBase64 value into the thrown Error. Since that key is the root secret for E2E encrypted channels and exceptions routinely propagate to logs, error-tracking services, CI output, and HTTP error responses, a length mismatch (e.g. a stray trailing newline, or passing a base64 key to the raw-bytes option) can persist the live key in those sinks.

This reports only the key length in the error, never the value. No other functional change.

Tests

Existing assertions match the byte-count text (… bytes long / decodes to N bytes), which is preserved — no test changes needed.

@lgomezma lgomezma marked this pull request as ready for review June 4, 2026 10:03
@lgomezma lgomezma merged commit be7cea3 into master Jun 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants