Overflow in OpenSSL EVP CipherUpdate, EVP EncryptUpdate, and EVP DecryptUpdate Functions

openssl Updated 02 Oct 2025

Summary

16/02/2021
N/A
Yes i
High
7.5

CVE-2021-23840: Calls to EVP_CipherUpdate, EVP_EncryptUpdate and EVP_DecryptUpdate may overflow the output length argument in some cases where the input length is close to the maximum permissable length for an integer on the platform. Affects openssl across 4 version ranges.

< 1.1.1j-r0 < 57679e1c97a90057d5ca9e1f0d1f3c6255d20200 < e5d189ecb9465f4be6235109dd3dbcaab01ddc53 < fab0396eab86e8236899c69d3a56baad00e5af14

Fixed in 1.1.1j-r0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

OpenSSL is an open-source software library that provides cryptographic functions to secure communications over computer networks. It is widely used in various applications, including web servers, email servers, and VPNs. The library implements a wide range of cryptographic algorithms and protocols, making it a critical component for secure communication. However, a vulnerability has been discovered in the EVP_CipherUpdate, EVP_EncryptUpdate, and EVP_DecryptUpdate functions of OpenSSL, which could lead to application crashes or incorrect behavior.

Vulnerability Detail

The vulnerability, identified as CVE-2021-23840, occurs when calls to the EVP_CipherUpdate, EVP_EncryptUpdate, and EVP_DecryptUpdate functions result in an overflow of the output length argument. This overflow can happen when the input length is close to the maximum permissible length for an integer on the platform. While the function call returns a success value of 1, the output length value becomes negative. This can cause applications to behave incorrectly or crash. The vulnerability affects OpenSSL versions 1.1.1i and below, as well as OpenSSL 1.0.2x and below (which is no longer receiving public updates).

How To Fix

Minimum fixed version

1.1.1j-r0

This is the first release that contains the fix.

sudo apk add --upgrade openssl

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no specific workaround provided for this vulnerability. The recommended solution is to upgrade to the fixed versions of OpenSSL.

Conclusion

The vulnerability in the EVP_CipherUpdate, EVP_EncryptUpdate, and EVP_DecryptUpdate functions of OpenSSL can lead to application crashes or incorrect behavior. It is important to upgrade to the fixed versions of OpenSSL to mitigate this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for openssl →

Share this vulnerability

FAQ

OpenSSL is an open-source software library that provides cryptographic functions for secure communication over computer networks.

The EVP_CipherUpdate, EVP_EncryptUpdate, and EVP_DecryptUpdate functions in OpenSSL are affected by this vulnerability.

The vulnerability can cause applications to behave incorrectly or crash, potentially leading to a denial of service or other security issues.

OpenSSL versions 1.1.1i and below, as well as OpenSSL 1.0.2x and below, are affected by this vulnerability.

Users should upgrade to OpenSSL 1.1.1j if using versions 1.1.1i and below. Users of OpenSSL 1.0.2x and below with premium support should upgrade to OpenSSL 1.0.2y. Other users of OpenSSL 1.0.2x and below should upgrade to OpenSSL 1.1.1j.

Related vulnerabilities

Recent vulnerabilities recorded for openssl.

How To Fix

Minimum fixed version

1.1.1j-r0

This is the first release that contains the fix.

sudo apk add --upgrade openssl

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback