Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1910749

Summary: ECDHE ciphers missing in rh-nodejs12
Product: Red Hat Software Collections Reporter: Yuri Arabadji <yuri>
Component: nodejsAssignee: Jan Staněk <jstanek>
Status: CLOSED EOL QA Contact: Jan Houska <jhouska>
Severity: high Docs Contact:
Priority: unspecified    
Version: rh-nodejs12CC: bmikulov, hhorak, jeffrey.dillahay, jhouska, jstanek, msuchy
Target Milestone: alphaKeywords: Reopened, TestCaseNeeded, Triaged, ZStream
Target Release: 3.7Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1934642 1942592 (view as bug list) Environment:
Last Closed: 2022-09-09 13:05:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1934642    
Bug Blocks: 1942592    
Attachments:
Description Flags
minimal fix none

Description Yuri Arabadji 2020-12-24 11:58:40 UTC
Hi.

Someone broke ECDHE cipherset in rh-nodejs12-nodejs-12.19.1-2.el7.x86_64.rpm 
It works just fine with previous version rh-nodejs12-nodejs-12.18.2-1.el7.x86_64 .

The error that occurs when trying to negotiate any ECDHE cipher (e.g., ECDHE-RSA-AES128-GCM-SHA256) on the sever side is:  
Error: 140121568671872:error:1408A0C1:SSL routines:ssl3_get_client_hello:no shared cipher:s3_srvr.c:1435:


The application is https://github.com/haraka/Haraka and I don't have an easily reproducible case here as that would require installing and configuring whole app and I don't know the details on how the server/SSL creation is done.

Maybe there's something that you've touched recently that might've been related to ECDH?

Thanks.

Comment 1 Yuri Arabadji 2020-12-24 14:06:57 UTC
Problem doesn't manifest itself if using stock node from https://nodejs.org/dist/v12.19.1/node-v12.19.1-linux-x64.tar.xz

Comment 4 jeff dillahay 2021-01-27 15:49:20 UTC
The below code works on 12.18.2 but not 12.19.1

#!/usr/bin/node 

const fs = require('fs')

require('tls')
.createServer(
        // options
        {

                key: fs.readFileSync('test.key'),
                cert: fs.readFileSync('test.cer'),
                ca: [ fs.readFileSync('root.cer') ],
//                ciphers: 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256',
        }, 
        // handler
        (socket) => socket.write('HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\nContent-Length: 2\r\nConnection: close\r\n\r\nOK\r\n')
)
.listen(8433, () => { console.log(`listening on ${8433}`) })

Comment 5 jeff dillahay 2021-01-27 15:55:03 UTC
The above code has the "cipher" line commented out, but if you uncomment that and run on 12.19.1, this will replicate the problem.

Comment 6 Jan Staněk 2021-03-03 13:26:05 UTC
Created attachment 1760390 [details]
minimal fix

After investigation, this issue first manifested in v12.18.4, which conincides with a OpenSSL patch refactoring effort. During the refactor, a part of the patch was missed which was necessary to properly setup ECDHE negotiation with OpenSSL 1.0.* – see the patch for the missing part.

The fix was tested with the provided reproducer – thanks a lot for it!

Since the same refactored patches are used in rh-nodejs14, it stands to reason it is broken there as well. I will investigate further and clone this appropriately.

Comment 13 RHEL Program Management 2021-07-08 07:30:50 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.

Comment 14 Jan Staněk 2021-07-08 12:29:31 UTC
The release with a fix is currently being worked on. Re-opening.

Comment 17 Jan Houska 2021-07-22 10:47:29 UTC
NEW PASS:
version:
rh-nodejs12-nodejs-12.21.0-1.el7.x86_64

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [ 06:44:35 ] :: [  BEGIN   ] :: Running reproducer :: actually running 'node server.js &> server.log &'
:: [ 06:44:35 ] :: [   PASS   ] :: Running reproducer (Expected 0, got 0)
:: [ 06:44:35 ] :: [   LOG    ] :: Reporoducer is running on PID=14875
:: [ 06:44:36 ] :: [  BEGIN   ] :: Running 'curl -k https://localhost:8433 &> curl.log'
:: [ 06:44:36 ] :: [   PASS   ] :: Command 'curl -k https://localhost:8433 &> curl.log' (Expected 0, got 0)
:: [ 06:44:36 ] :: [  BEGIN   ] :: Running 'kill 14875'
/usr/share/beakerlib/testing.sh: řádek 756: 14875 Ukončen (SIGTERM)      node server.js &>server.log
:: [ 06:44:36 ] :: [   PASS   ] :: Command 'kill 14875' (Expected 0, got 0)
:: [ 06:44:36 ] :: [   PASS   ] :: File 'server.log' should contain 'listening on 8433' 
--------server.log:------
listening on 8433
--------\server.log------
:: [ 06:44:36 ] :: [   PASS   ] :: File 'curl.log' should contain 'OK' 
:: [ 06:44:36 ] :: [   PASS   ] :: File 'curl.log' should not contain 'curl: (35) Cannot communicate securely with peer: no common encryption algorithm(s).' 
--------curl.log:------
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100     2  100     2    0     0     18      0 --:--:-- --:--:-- --:--:--    18
OK--------\curl.log------
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Duration: 1s
::   Assertions: 6 good, 0 bad
::   RESULT: PASS (Test)


Old FAIL:
version:
rh-nodejs12-nodejs-12.19.1-2.el7.x86_64

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [ 06:44:34 ] :: [  BEGIN   ] :: Running reproducer :: actually running 'node server.js &> server.log &'
:: [ 06:44:34 ] :: [   PASS   ] :: Running reproducer (Expected 0, got 0)
:: [ 06:44:34 ] :: [   LOG    ] :: Reporoducer is running on PID=12445
:: [ 06:44:35 ] :: [  BEGIN   ] :: Running 'curl -k https://localhost:8433 &> curl.log'
:: [ 06:44:36 ] :: [   FAIL   ] :: Command 'curl -k https://localhost:8433 &> curl.log' (Expected 0, got 35)
:: [ 06:44:36 ] :: [  BEGIN   ] :: Running 'kill 12445'
/usr/share/beakerlib/testing.sh: řádek 756: 12445 Ukončen (SIGTERM)      node server.js &>server.log
:: [ 06:44:36 ] :: [   PASS   ] :: Command 'kill 12445' (Expected 0, got 0)
:: [ 06:44:36 ] :: [   PASS   ] :: File 'server.log' should contain 'listening on 8433' 
--------server.log:------
listening on 8433
--------\server.log------
:: [ 06:44:36 ] :: [   FAIL   ] :: File 'curl.log' should contain 'OK' 
:: [ 06:44:36 ] :: [   FAIL   ] :: File 'curl.log' should not contain 'curl: (35) Cannot communicate securely with peer: no common encryption algorithm(s).' 
--------curl.log:------
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (35) Cannot communicate securely with peer: no common encryption algorithm(s).
--------\curl.log------
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Duration: 2s
::   Assertions: 3 good, 3 bad
::   RESULT: FAIL (Test)

Comment 18 Jan Staněk 2021-08-09 09:29:23 UTC
The z-stream errata should now be shipped. Switching this y-stream tracker ON_QA for verification.

Comment 20 Joe Orton 2022-09-09 13:05:23 UTC
In accordance with the Red Hat Software Collections Product Life Cycle, the support period for this collection has ended.

New bug fix, enhancement, and security errata updates, as well as technical support services will no longer be made available for this collection.

Customers are encouraged to upgrade to a later release.

Please contact Red Hat Support if you have further questions, or refer to the support lifecycle page for more information. https://access.redhat.com/support/policy/updates/rhscl/