crypto: free disabled OpenSSL compression methods#64683
Open
BridgeAR wants to merge 1 commit into
Open
Conversation
Collaborator
|
Review requested:
|
BridgeAR
force-pushed
the
BridgeAR/2026-07-22-fix-openssl-compression-leak
branch
from
July 22, 2026 20:58
8ef0f45 to
4ad0562
Compare
Node's compression-enabled OpenSSL build allocates TLS record-compression methods during startup. Clearing the stack loses the only pointers without freeing entries, so LeakSanitizer reports a 24-byte leak. Pop and free every method while preserving the OpenSSL-owned stack. Record compression remains unavailable process-wide, including when SSL_CONF attempts to enable it at a lower security level. 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 23, 2026 12:21
4ad0562 to
0469d65
Compare
BridgeAR
marked this pull request as ready for review
July 23, 2026 14:27
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's compression-enabled OpenSSL build initializes the legacy TLS record-compression methods during startup.
sk_SSL_COMP_zero()removed those methods from the stack without freeing them, so LeakSanitizer reported a 24-byte leak after otherwise successful test runs.Free each method before removing it while keeping OpenSSL's stack container valid. This preserves Node's process-wide CRIME protection, including when
SSL_CONFenables record compression at security level 1, while certificate compression remains available.The regression test starts Node with that unsafe OpenSSL configuration and verifies that its TLS 1.2 ClientHello still advertises only null compression. Without the fix it also advertises zlib.
Refs: #62217