crypto: stop clearing OpenSSL compression methods#64683
Draft
BridgeAR wants to merge 1 commit into
Draft
Conversation
Collaborator
|
Review requested:
|
OpenSSL allocates the built-in record-compression methods while creating its global context. Clearing the stack drops the only pointers without freeing the entries, so LeakSanitizer reports a 24-byte leak at process shutdown. OpenSSL disables record compression on every new SSL_CTX by default. Node does not expose SSL_CTX_clear_options(), so the extra process-wide clearing is not needed to protect against CRIME. Refs: nodejs#62217 Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de>
BridgeAR
force-pushed
the
BridgeAR/2026-07-22-fix-openssl-compression-leak
branch
from
July 22, 2026 20:58
8ef0f45 to
4ad0562
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Node 26's OpenSSL build now includes compression support. During startup, Node clears OpenSSL's global record-compression method stack with
sk_SSL_COMP_zero(), which drops the only pointers to the allocatedSSL_COMPentries. LeakSanitizer reports the lost 24-byte allocation on every process.OpenSSL sets
SSL_OP_NO_COMPRESSIONon every newSSL_CTX, and Node only exposesSSL_CTX_set_options(). Removing the global stack clear keeps record compression disabled without discarding OpenSSL-owned pointers.The existing
LEAK_SANITIZERcheck inNodeMainInstance::Run()covers this on sanitizer builds. Every test process exercises the path, so a dedicated JavaScript test would not add coverage.Refs: #62217