Title: CVE-2021-3711 EVP_PKEY_decrypt() vulnerability in StarWind products

Note: StarWind will continue to update this vulnerability as new information becomes available

Vulnerability ID: SW-20230222-0001

Version: 1.0

Date: 2023-02-22

Status: Final

CVEs: CVE-2021-3711

Summary

In order to decrypt SM2 encrypted data an application is expected to call the API function EVP_PKEY_decrypt(). Typically an application will call this function twice. The first time, on entry, the “out” parameter can be NULL and, on exit, the “outlen” parameter is populated with the buffer size required to hold the decrypted plaintext. The application can then allocate a sufficiently sized buffer and call EVP_PKEY_decrypt() again, but this time passing a non-NULL value for the “out” parameter. A bug in the implementation of the SM2 decryption code means that the calculation of the buffer size required to hold the plaintext returned by the first call to EVP_PKEY_decrypt() can be smaller than the actual size required by the second call.

Impact

This can lead to a buffer overflow when EVP_PKEY_decrypt() is called by the application a second time with a buffer that is too small. A malicious attacker who is able present SM2 content for decryption to an application could cause attacker chosen data to overflow the buffer by up to a maximum of 62 bytes altering the contents of other data held after the buffer, possibly changing application behaviour or causing the application to crash. The location of the buffer is application dependent but is typically heap allocated. Fixed in OpenSSL 1.1.1l (Affected 1.1.1-1.1.1k).

Vulnerability Scoring

CVE CVSS 2.0 Score CVSS 3.x Score
CVE-2021-3711 7.5 (HIGH) 9.8 (CRITICAL)

Vector

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

References

Resource Hyperlink
NVD NVD – CVE-2021-3711 (nist.gov)

 

Affected Products: 

StarWind SAN&NAS V8 R13

Not affected products:

StarWind HCA and Command Center (all versions)

StarWind VSAN (all versions)

StarWind VTL component (all versions for Windows Server)

StarWind V2V (all versions)

StarWind Tape Redirector component (all versions)

StarWind Deduplication Analyzer (all versions)

StarWind rPerf (all versions)

StarWind iSCSI Accelerator (all versions)

StarWind NVMe-oF Initiator (all versions)

Software Versions and Fixes

Fixed in StarWind SAN&NAS V8 R14

Workaround

Update StarWind SAN&NAS to V8 R14 or higher

Obtaining Software Fixes 

Software updates will be available in StarWind release notes – https://www.starwindsoftware.com/release-notes-build. To update the software, perform the steps described at the following link  – https://knowledgebase.starwindsoftware.com/guidance/upgrading-from-any-starwind-version-to-any-starwind-version/ or contact support to perform an update. You can submit a support request using the following link https://www.starwindsoftware.com/support-form or contact Support directly via email support@starwind.com or via phone +1 617 829 4499.

Status of Notice

Final

StarWind will continue to update information regarding this vulnerability as new details become available.

This vulnerability article should be considered as the single source of current, up-to-date, authorized and accurate information posted by StarWind Software.

Revision History 

Revision # Date Comments
1.0 2023-02-22 Initial and Final Public Release