[4.4.0] Hardcoded TLS key exchange algorithms excludes post-quantum (PQC)
I have checked the following:
- [x] I have searched existing issues and found nothing related to my issue.
This bug is:
- [ ] Making Bruno unusable for me.
- [ ] Slowing me down but I'm able to continue working.
- [ ] Annoying.
- [ ] This feature was working in a previous version but is broken in the current release.
Bruno version
4.4.0 Future
💻 Operating System
Windows
Specific OS Version / Distro
No response
🐞 Describe the bug
Description
In the recent changes targeting version 4.4.0, it appears that the key exchange algorithms are being hardcoded in a way that excludes post-quantum (PQC) cryptography.
Problem
The current implementation in PR https://github.com/usebruno/bruno/pull/9666 hardcodes the supported key exchange mechanisms (https://github.com/sid-bruno/bruno/blob/df56e75847378e6ed83e2072080207c96282e742/packages/bruno-cli/bin/bru.js#L11), preventing users from leveraging full post-quantum cryptography, for instance X25519MLKEM768 hydrid key exchange and other, hydrid or full, post-quantum key exchange cryptography algorithms.
require('node:tls').DEFAULT_ECDH_CURVE = 'X25519:P-256:X448:P-521:P-384:ffdhe2048:ffdhe3072:ffdhe4096:ffdhe6144:ffdhe8192';
Impact
- Crypto-Agility: Hardcoding specific cryptographic primitives directly undermines the core principle of crypto-agility, making it difficult to adapt as standards evolve and threats emerge. https://csrc.nist.gov/projects/crypto-agility
- Compatibility Issues: This change will block Bruno from connecting to web servers, APIs, or services that strictly enforce or exclusively support post-quantum algorithms.
Proposed Solution
Remove the hardcoded restrictions on key exchange algorithms and allow dynamic configuration or full support for modern PQC groups/curves, ensuring Bruno remains future-proof.
📝 Steps to reproduce
- Download latest Bruno from source code
- Try to connect do an HTTPS endpoint that only accepts post-quantum hybrid or full key exhanges For instance, for hybrid post qauntum, in apache (with openssl 3.5+)
SSLProtocol TLSv1.3
SSLCipherSuite TLSv1.3 "TLS_AES_256_GCM_SHA384"
SSLOpenSSLConfCmd Curves X25519MLKEM768:SecP256r1MLKEM768:SecP384r1MLKEM1024
- Use Bruno to try to reach that endpoint, Notice you get a TLS handshake error
📁 Collection to reproduce
No response
📷 Screenshots/Live demo link
Browsers (Chrome, Firefox, Edge) already offer X25519MLKEM768; whether a connection uses it depends on the server or CDN, and the classical group stays as a fallback.
Step-by-step guide: https://ather-quantum.com/guides/harvest-now-decrypt-later To verify from outside (which group the server actually negotiates): https://ather-quantum.com/?domain=yourdomain
(Disclosure: I run that scanner; the guide and the check are free.)
Hi @sciaw , thanks for reporting this. We’ve acknowledged it and are looking into it with the engineering team. We’ll update you here once we have more.
https://github.com/usebruno/bruno/pull/9864#issuecomment-6970421370
Thanks, @sid-bruno. Given the Electron/BoringSSL compatibility concern you raised in #9864, I’d test removing Bruno’s override with the actual packaged desktop app and the CLI. For each, I’d check a TLS 1.3 endpoint that accepts only X25519MLKEM768, a classical-only endpoint that accepts X25519 or P-256, and the legacy endpoint that originally prompted the override. Where the runtime supports the hybrid group, the first case should negotiate it, and the classical-only case should succeed on the first connection. That matrix would show whether the runtime defaults cover both cases before adding a retry.
The other thing I forgot to mention was that https://badssl.com/ which we use to test for ssl connections has a problem where nginx configuration of a smaller payload size cause connections to fail because the post-quantum key is larger than what was configured.
The hard coded part was added for that reason and was the primary driving factor for it.
This is something that'd fail for any user who's restricted body size and for them the node22 version worked without any problem but suddenly the new app would not so I just added the compat in both electron and CLI.
BoringSSL should also be able to handle this for the most part but will need to force enable it in that case, the regression of something working in 4.3.0 because of node version and the same request failing in 4.4.0 was the reason for the compat, we obviously don't want it failing for servers that only have post quantum setup so I guess the other option is to dynamically check the handshake with both and then decide what to go ahead with which might increase the latency of the response
Thanks, @sid-bruno. The BadSSL example clarifies the compatibility constraint. The split in #9864 looks promising for the CLI: advertise X25519MLKEM768 in supported_groups while sending only an X25519 key share in the first ClientHello. A classical server can proceed immediately, and a hybrid-only TLS 1.3 server can request the hybrid share with HelloRetryRequest on the same connection. The hybrid-only path adds a round trip without probing every host twice. I’d verify both the actual ClientHello and the BadSSL regression separately in the packaged desktop app, since the CLI test alone can’t establish Electron’s behavior.
This is definitely an edge case since badssl is probably the only one where a key <2KB is being thrown away but the possibility of other people having such servers isn't 0 so let me try the suggested approach and see if that helps