FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

crypto: free disabled OpenSSL compression methods by BridgeAR · Pull Request #64683 · nodejs/node · GitHub

/ node Public

crypto: free disabled OpenSSL compression methods - #64683

Open
BridgeAR wants to merge 1 commit into
nodejs:mainfrom
BridgeAR:BridgeAR/2026-07-22-fix-openssl-compression-leak
Open

crypto: free disabled OpenSSL compression methods#64683
BridgeAR wants to merge 1 commit into
nodejs:mainfrom
BridgeAR:BridgeAR/2026-07-22-fix-openssl-compression-leak

Conversation

BridgeAR commented Jul 22, 2026
edited
Loading

Copy link
Copy Markdown
Member

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_CONF enables 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

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto

nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. crypto Issues and PRs related to the crypto subsystem. needs-ci PRs that need a full CI run. labels Jul 22, 2026
BridgeAR force-pushed the BridgeAR/2026-07-22-fix-openssl-compression-leak branch from 8ef0f45 to 4ad0562 Compare July 22, 2026 20:58
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 4ad0562 to 0469d65 Compare July 23, 2026 12:21
BridgeAR changed the title crypto: stop clearing OpenSSL compression methods crypto: free disabled OpenSSL compression methods Jul 23, 2026
BridgeAR marked this pull request as ready for review July 23, 2026 14:27

codecov Bot commented Jul 23, 2026
edited
Loading

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.13%. Comparing base (3437feb) to head (0469d65).
⚠️ Report is 179 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #64683      +/-   ##
==========================================
- Coverage   90.13%   90.13%   -0.01%     
==========================================
  Files         741      741              
  Lines      242158   242161       +3     
  Branches    45608    45612       +4     
==========================================
- Hits       218265   218260       -5     
- Misses      15361    15381      +20     
+ Partials     8532     8520      -12     
Files with missing lines Coverage Δ
src/crypto/crypto_util.cc 72.63% <100.00%> (+0.17%) ⬆️

... and 26 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

pimterry left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Some linting errors here, otherwise LGTM 👍

trivikr commented Aug 23, 2026

Copy link
Copy Markdown
Member

@BridgeAR Can you please fix the lint errors and rebase?

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

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. crypto Issues and PRs related to the crypto subsystem. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL