Cloudanix VulnDB

CVE-2021-23839

Low · 3.7

CVSS

3.7

EPSS

3.0%

Published

Feb 16, 2021

CISA due date

—

Cloudanix analysis

Monitor only SSVC: Track

An older encryption library contained a logic error that could let attackers force servers into using outdated insecure communication methods when very specific legacy settings were turned on.

Exploitation
Remote Unauthenticated
Attacker needs
None
Complexity
High
Impact
Data Tampering
Component
Library
Class
Cryptographic Weakness
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

The RSA_padding_check_SSLv23 function inverts the version rollback padding check, causing servers to accept connections that indicate a rollback attack and reject legitimate SSLv2 attempts when SSLv2 support is explicitly enabled at compile and runtime.

Why it matters to the business

Organizations still running end-of-life OpenSSL 1.0.2 with the obsolete SSLv2 protocol enabled face a narrow risk of weakened cryptographic negotiation that could allow downgrade to insecure legacy protocols, though the required configuration is non-default and rare in modern deployments.

How an attack unfolds

An attacker initiates an SSLv2 handshake containing the special rollback padding bytes toward a server that has SSLv2 compiled in, enabled at runtime, and configured with SSLv2 ciphers; the inverted logic accepts the malformed padding, establishing a connection that should have been rejected as a rollback attempt.

How to fix it

Upgrade all OpenSSL 1.0.2 installations to version 1.0.2y or later; the fix is present in commit bf059c2efc4db5c09970fd3d2c392432b0ac6a12. Disable SSLv2 at compile time and ensure no SSLv2 ciphersuites are configured at runtime. Applications directly invoking RSA_padding_check_SSLv23 or RSA_SSLV23_PADDING should migrate to current OpenSSL 1.1.1 or 3.x releases.

How to confirm the fix worked

Confirm the running OpenSSL version is 1.0.2y or newer, verify SSLv2 is disabled via openssl s_client -ssl2 tests returning errors, and review build configuration to ensure SSLv2 support was not compiled in.

Typical attack path

  1. Identify servers advertising SSLv2 support via network scanning
  2. Craft an SSLv2 ClientHello containing RSA_SSLV23_PADDING rollback indicators
  3. Send the malformed handshake to trigger the inverted padding check
  4. Complete the SSLv2 session if accepted, enabling further protocol downgrade or observation

How to detect it

Review application and TLS handshake logs for unexpected successful SSLv2 sessions or connections using RSA_SSLV23_PADDING; monitor for any process loading OpenSSL 1.0.2 libraries between versions s and x.

What your security team should do

  • Immediately inventory all systems for OpenSSL 1.0.2s through 1.0.2x and schedule upgrades to 1.0.2y or 1.1.1j
  • Audit configuration files and build scripts to ensure SSLv2 remains disabled
  • Add version checks for OpenSSL libraries to continuous compliance scanning
  • Treat any remaining 1.0.2 deployments as high-priority technical debt requiring migration

The record

OpenSSL 1.0.2 supports SSLv2. If a client attempts to negotiate SSLv2 with a server that is configured to support both SSLv2 and more recent SSL and TLS versions then a check is made for a version rollback attack when unpadding an RSA signature. Clients that support SSL or TLS versions greater than SSLv2 are supposed to use a special form of padding. A server that supports greater than SSLv2 is supposed to reject connection attempts from a client where this special form of padding is present, because this indicates that a version rollback has occurred (i.e. both client and server support greater than SSLv2, and yet this is the version that is being requested). The implementation of this padding check inverted the logic so that the connection attempt is accepted if the padding is present, and rejected if it is absent. This means that such as server will accept a connection if a version rollback attack has occurred. Further the server will erroneously reject a connection if a normal SSLv2 connection attempt is made. Only OpenSSL 1.0.2 servers from version 1.0.2s to 1.0.2x are affected by this issue. In order to be vulnerable a 1.0.2 server must: 1) have configured SSLv2 support at compile time (this is off by default), 2) have configured SSLv2 support at runtime (this is off by default), 3) have configured SSLv2 ciphersuites (these are not in the default ciphersuite list) OpenSSL 1.1.1 does not have SSLv2 support and therefore is not vulnerable to this issue. The underlying error is in the implementation of the RSA_padding_check_SSLv23() function. This also affects the RSA_SSLV23_PADDING padding mode used by various other functions. Although 1.1.1 does not support SSLv2 the RSA_padding_check_SSLv23() function still exists, as does the RSA_SSLV23_PADDING padding mode. Applications that directly call that function or use that padding mode will encounter this issue. However since there is no support for the SSLv2 protocol in 1.1.1 this is considered a bug and not a security issue in that version. OpenSSL 1.0.2 is out of support and no longer receiving public updates. Premium support customers of OpenSSL 1.0.2 should upgrade to 1.0.2y. Other users should upgrade to 1.1.1j. Fixed in OpenSSL 1.0.2y (Affected 1.0.2s-1.0.2x).

Affected packages

Ecosystem Package Introduced Fixed
Alpine:v3.10 openssl 0 1.1.1j-r0
Alpine:v3.11 openssl 0 1.1.1j-r0
Alpine:v3.12 openssl 0 1.1.1j-r0
Alpine:v3.13 openssl 0 1.1.1j-r0
Alpine:v3.14 openssl 0 1.1.1j-r0
Alpine:v3.15 openssl 0 1.1.1j-r0
Alpine:v3.15 openssl3 0 1.1.1j-r0
Alpine:v3.16 openssl 0 1.1.1j-r0
Alpine:v3.16 openssl3 0 1.1.1j-r0
Alpine:v3.17 openssl 0 1.1.1j-r0
Alpine:v3.18 openssl 0 1.1.1j-r0
Alpine:v3.19 openssl 0 1.1.1j-r0
Alpine:v3.20 openssl 0 1.1.1j-r0
Alpine:v3.21 openssl 0 1.1.1j-r0
Alpine:v3.22 openssl 0 1.1.1j-r0
Alpine:v3.9 openssl 0 1.1.1j-r0
Debian:11 openssl 0 1.0.0d-1
Debian:12 openssl 0 1.0.0d-1
Debian:13 openssl 0 1.0.0d-1
conan openssl 1.0.2s No fix

Related vulnerabilities