Lucene search

K
hackeroneMjones-vsatH1:1808596
HistoryDec 16, 2022 - 9:14 p.m.

Node.js: Multiple OpenSSL error handling issues in nodejs crypto library

2022-12-1621:14:34
mjones-vsat
hackerone.com
104

7.5 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

NONE

Integrity Impact

NONE

Availability Impact

HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

5 Medium

CVSS2

Access Vector

NETWORK

Access Complexity

LOW

Authentication

NONE

Confidentiality Impact

NONE

Integrity Impact

NONE

Availability Impact

PARTIAL

AV:N/AC:L/Au:N/C:N/I:N/A:P

0.001 Low

EPSS

Percentile

32.8%

Summary: NodeJS up to 19.2.0 does not clear the OpenSSL error stack after operations that may set it

Description: NodeJS up to 19.2.0 does not clear the OpenSSL error stack after operations that may set it. This may lead to false positive errors during subsequent cryptographic operations that happen to be on the same thread.

Steps To Reproduce:

The following issues have reproduction cases:

https://github.com/nodejs/node/pull/45495
https://github.com/nodejs/node/pull/45377

Upon reviewing the code in crypto_x509.cc, at least one other function lacks use of ClearErrorOnReturn - X509Certificate::CheckPrivateKey.

https://github.com/nodejs/node/blob/main/src/crypto/crypto_x509.cc#L432

Impact:

On our application, JWTs failed to sign after a certificate fails to verify on the same thread.

Impact

If the server verifies certificates using Node’s X509Certificate API, it may fail to sign other users’ auth tokens: if a certificate fails to verify, the error from the previous failing call is applied to the next call that should succeed. It is worth auditing all OpenSSL entry points to see if they can cause errors to be raised.

7.5 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

NONE

Integrity Impact

NONE

Availability Impact

HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

5 Medium

CVSS2

Access Vector

NETWORK

Access Complexity

LOW

Authentication

NONE

Confidentiality Impact

NONE

Integrity Impact

NONE

Availability Impact

PARTIAL

AV:N/AC:L/Au:N/C:N/I:N/A:P

0.001 Low

EPSS

Percentile

32.8%