Repository navigation
tls: docs-deprecate TLS renegotiation, add allowRenegotiation opt-in - #67532
Conversation
|
Review requested:
|
|
The
notable-change
Please suggest a text for the release notes if you'd like to include a more detailed summary, then proceed to update the PR description with the text or a link to the notable change suggested text comment. Otherwise, the commit will be placed in the Other Notable Changes section. |
For now this changes very little, but offers an option to directly control whether this is supported. In future, this will default to 'false' (disabling by default) and eventually be mostly removed, except opt-in client support for accepting renegotiation requests from servers. Signed-off-by: Tim Perry <pimterry@gmail.com>
56d9f29 to
118c40f
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #67532 +/- ##
==========================================
+ Coverage 90.66% 90.68% +0.01%
==========================================
Files 799 800 +1
Lines 280252 280555 +303
Branches 54121 54191 +70
==========================================
+ Hits 254088 254416 +328
+ Misses 16285 16233 -52
- Partials 9879 9906 +27
🚀 New features to boost your workflow:
|
mcollina
left a comment
There was a problem hiding this comment.
I'm actually ok in disabling it by default and/or removing it entirely even in previous releases (will require a tsc approval).
|
Looks like people are on board 😄
I would love to kill all this even sooner, but I'm not sure we can easily, since there are real apps using this for specific niche cases (like Kibana) so this would mean at least some production breakage for end users in a minor bump. There's a good security argument, but it would make a mess. If we really do want to, we could try to coordinate with existing users but we'll struggle to find them since I expect it's mostly legacy application code (not OSS libs). There are other middle grounds though. We could backport just an update to the security model (exclude renegotiation from it) plus a runtime warning for anybody who uses it, like: "You are using TLS renegotiation, be aware that this has security risks, and usage is outside the scope of the Node.js security model". That'd simplify our vulnerability handling but limit breakage to just a warning. (Might be worth considering more generally actually. Could we exclude issues in all runtime-deprecated features from being treated as vulnerabilities? We do the same for experimental features, you use them at your own risk) |
|
Landed in b7df44b |
For now this changes very little, but offers an option to directly control whether this is supported. In future, this will default to 'false' (disabling by default) and eventually be mostly removed, except opt-in client support for accepting renegotiation requests from servers. Signed-off-by: Tim Perry <pimterry@gmail.com> PR-URL: #67532 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
I think we should deprecate TLS renegotiation support, disable it by default soon, and aim to eventually mostly remove it.
Quick refresher: renegotiation is a TLS 1.2 feature (not in 1.3) where the client or server can ask the other peer to change the configuration of an existing connection, redo the handshake, and then continue with that new configuration on the old TLS connection. Today we support this in all 4 directions by default: initiating renegotiation for both clients & servers, and accepting remote requests for renegotiation from clients or servers.
Steps would be:
I think we should drop this because:
We did previously discuss this 10 years ago: #6983. At the time it was challenging, but in the meantime I think the ecosystem consensus has changed, and most of the remaining use cases have become unsupported everywhere else. Only the one use case remains, exclusively for accessing specific legacy server configurations.
This PR does nothing breaking for now, it's just laying the groundwork, which we'll want to backport to v26 too:
allowRenegotiationoption for clients & servers to explicitly enable/disable renegotiation from options. Defaults totruefor now, will flip tofalsefor v27 imminently.--pending-deprecationwarning if you use renegotiation, except for clients that setallowRenegotiation: trueand just accept server-initiated requests.Notable change:
TLS 1.2 renegotiation, which allows either peer to redo the handshake and change the configuration of an existing connection, is now deprecated (DEP0213). It is hard to use securely, is forbidden by HTTP/2, and was removed entirely in TLS 1.3.
A new
allowRenegotiationoption fortls.connect()andtls.createServer()controls whether renegotiation is enabled on connections. It defaults totruefor now, but renegotiation will be disabled by default in a future major release such that enabling this explicitly will be required. In a subsequent major release, it is likely to be removed entirely, except for opt-in support for clients to accept received renegotiation requests from legacy servers. Run with--pending-deprecationto find affected code.