Advisory ID: SYSS-2021-062
Affected Version(s): 126.96.36.199, 188.8.131.52, 19c
Tested Version(s): 18c
Vulnerability Type: Inadequate Encryption Strength (CWE-326)
Risk Level: Medium
Solution Status: Fixed
Manufacturer Notification: 2021-03-17
Solution Date: 2021-08-07
Public Disclosure: 2021-12-10
CVE Reference: CVE-2021-2351
Author of Advisory: Moritz Bechler, SySS GmbH
Oracle Database is a general purpose relational database management
The manufacturer describes the product as follows (see ):
"Oracle database products offer customers cost-optimized and high-performance
versions of Oracle Database, the world's leading converged, multi-model
database management system, as well as in-memory, NoSQL and MySQL databases.
Oracle Autonomous Database, available on premises via Oracle Cloud@Customer
or in the Oracle Cloud Infrastructure, enables customers to simplify relational
database environments and reduce management workloads."
To protect the client/server communication, a proprietary security protocol
"Native Network Encryption" (NNE) is used.
A TLS-based alternative can optionally be configured.
NNE's integrity protection mechanism deliberately weakens the key used
for computing per-packet message authentication codes (MACs).
When analyzing the protocol details, SySS found out that depending on
the selected hash algorithms, one of two key generation schemes is used.
Both are seeded with material from the established session key.
However, even for the AES-based key generator, which is used when modern
cryptographic primitives are selected, the session key is truncated to
For more details on the protocol and MAC computation, refer to our
Brute-force cracking of that key, for example if only integrity but no
encryption is enabled, is likely possible and allows malicious
manipulation of transmitted database commands or data.
Proof of Concept (PoC):
The initialization of the key generator, as originally implemented, can
be described with the following Python code, where SK is the established
session key, and the initialization vector (IV) was exchanged in
clear text during NNE negotiation.
mk = SK[0:5] + b'\xFF' + b'\x00' * 10
self.m = AES.new(mk, AES.MODE_CBC, iv=IV[0:16])
self.ms = b'\x00'*32
self.ms = s = self.m.encrypt(self.ms)
self.m = AES.new(s[0:16], AES.MODE_CBC, iv=s[16:32])
k1 = s[0:5] + b'\xB4' + s[6:16]
self.s2c = AES.new(k1, AES.MODE_CBC, iv=s[16:32])
self.s2cs = b'\x00' * 32
k2 = s[0:5] + b'\x5A' + s[6:16]
self.c2s = AES.new(k2, AES.MODE_CBC, iv=s[16:32])
self.c2ss = b'\x00' * 32
A per-packet key "k" is then generated like
self.c2ss = k = self.c2s.encrypt(self.c2ss)
and appended to the packet data as well as hashed using the selected hash algorithm.
Update the Oracle Database servers and clients to the patched versions.
Enforce usage of a secured protocol version by setting the following options:
Or use TLS-based transport security instead of Native Network Encryption.
https://support.oracle.com/rs?type=doc&id=2791571.1 (customer account required)
2013-03-02: Vulnerability discovered
2021-03-17: Vulnerability reported to manufacturer
2021-07-20: Initial patch release by manufacturer,
2021-08-07: Final patches released by manufacturer
2021-12-10: Public disclosure of vulnerability
 Product website for Oracle Database
 SySS Security Advisory SYSS-2021-062
 SySS Responsible Disclosure Policy
 Paper "Oracle Native Network Encryption"
This security vulnerability was found by Moritz Bechler of SySS GmbH.
Public Key: https://www.syss.de/fileadmin/dokumente/PGPKeys/Moritz_Bechler.asc
Key ID: 0x768EFE2BB3E53DDA
Key Fingerprint: 2C8F F101 9D77 BDE6 465E CCC2 768E FE2B B3E5 3DDA
The information provided in this security advisory is provided "as is"
and without warranty of any kind. Details of this security advisory may
be updated in order to provide as accurate information as possible. The
latest version of this security advisory is available on the SySS website.
Creative Commons - Attribution (by) - Version 3.0