Issue summary: Processing some specially crafted ASN.1 object identifiers or data containing them may be very slow.
Impact summary: Applications that use OBJ_obj2txt() directly, or use any of the OpenSSL subsystems OCSP, PKCS7/SMIME, CMS, CMP/CRMF or TS with no message size limit may experience notable to very long delays when processing those messages, which may lead to a Denial of Service.
An OBJECT IDENTIFIER is composed of a series of numbers - sub-identifiers - most of which have no size limit. OBJ_obj2txt() may be used to translate an ASN.1 OBJECT IDENTIFIER given in DER encoding form (using the OpenSSL type ASN1_OBJECT) to its canonical numeric text form, which are the sub-identifiers of the OBJECT IDENTIFIER in decimal form, separated by periods.
When one of the sub-identifiers in the OBJECT IDENTIFIER is very large (these are sizes that are seen as absurdly large, taking up tens or hundreds of KiBs), the translation to a decimal number in text may take a very long time. The time complexity is O(n^2) with n being the size of the sub-identifiers in bytes (*).
With OpenSSL 3.0, support to fetch cryptographic algorithms using names / identifiers in string form was introduced. This includes using OBJECT IDENTIFIERs in canonical numeric text form as identifiers for fetching algorithms.
Such OBJECT IDENTIFIERs may be received through the ASN.1 structure AlgorithmIdentifier, which is commonly used in multiple protocols to specify what cryptographic algorithm should be used to sign or verify, encrypt or decrypt, or digest passed data.
Applications that call OBJ_obj2txt() directly with untrusted data are affected, with any version of OpenSSL. If the use is for the mere purpose of display, the severity is considered low.
In OpenSSL 3.0 and newer, this affects the subsystems OCSP, PKCS7/SMIME, CMS, CMP/CRMF or TS. It also impacts anything that processes X.509 certificates, including simple things like verifying its signature.
The impact on TLS is relatively low, because all versions of OpenSSL have a 100KiB limit on the peers certificate chain. Additionally, this only impacts clients, or servers that have explicitly enabled client authentication.
In OpenSSL 1.1.1 and 1.0.2, this only affects displaying diverse objects, such as X.509 certificates. This is assumed to not happen in such a way that it would cause a Denial of Service, so these versions are considered not affected by this issue in such a way that it would be cause for concern, and the severity is therefore considered low.
The product allocates a reusable resource or group of resources on behalf of an actor without imposing any restrictions on the size or number of resources that can be allocated, in violation of the intended security policy for that actor.
Name | Vendor | Start Version | End Version |
---|---|---|---|
Openssl | Openssl | 1.0.2 (including) | 1.0.2zh (excluding) |
Openssl | Openssl | 1.1.1 (including) | 1.1.1u (excluding) |
Openssl | Openssl | 3.0.0 (including) | 3.0.9 (excluding) |
Openssl | Openssl | 3.1.0 (including) | 3.1.1 (excluding) |
JBoss Core Services for RHEL 8 | RedHat | jbcs-httpd24-openssl-1:1.1.1k-16.el8jbcs | * |
JBoss Core Services on RHEL 7 | RedHat | jbcs-httpd24-openssl-1:1.1.1k-16.el7jbcs | * |
Red Hat Enterprise Linux 9 | RedHat | openssl-1:3.0.7-16.el9_2 | * |
Red Hat Enterprise Linux 9 | RedHat | edk2-0:20230524-3.el9 | * |
Red Hat Enterprise Linux 9 | RedHat | openssl-1:3.0.7-16.el9_2 | * |
Red Hat JBoss Core Services 1 | RedHat | openssl | * |
Red Hat JBoss Web Server 5 | RedHat | openssl | * |
Red Hat JBoss Web Server 5.7 on RHEL 7 | RedHat | jws5-tomcat-native-0:1.2.31-16.redhat_16.el7jws | * |
Red Hat JBoss Web Server 5.7 on RHEL 8 | RedHat | jws5-tomcat-native-0:1.2.31-16.redhat_16.el8jws | * |
Red Hat JBoss Web Server 5.7 on RHEL 9 | RedHat | jws5-tomcat-native-0:1.2.31-16.redhat_16.el9jws | * |
Edk2 | Ubuntu | bionic | * |
Edk2 | Ubuntu | focal | * |
Edk2 | Ubuntu | jammy | * |
Edk2 | Ubuntu | kinetic | * |
Edk2 | Ubuntu | lunar | * |
Edk2 | Ubuntu | mantic | * |
Edk2 | Ubuntu | trusty | * |
Edk2 | Ubuntu | xenial | * |
Nodejs | Ubuntu | jammy | * |
Nodejs | Ubuntu | trusty | * |
Openssl | Ubuntu | bionic | * |
Openssl | Ubuntu | devel | * |
Openssl | Ubuntu | esm-infra/xenial | * |
Openssl | Ubuntu | fips-preview/jammy | * |
Openssl | Ubuntu | fips-updates/bionic | * |
Openssl | Ubuntu | fips-updates/focal | * |
Openssl | Ubuntu | fips-updates/jammy | * |
Openssl | Ubuntu | fips-updates/xenial | * |
Openssl | Ubuntu | fips/bionic | * |
Openssl | Ubuntu | fips/focal | * |
Openssl | Ubuntu | fips/xenial | * |
Openssl | Ubuntu | focal | * |
Openssl | Ubuntu | jammy | * |
Openssl | Ubuntu | kinetic | * |
Openssl | Ubuntu | lunar | * |
Openssl | Ubuntu | mantic | * |
Openssl | Ubuntu | noble | * |
Openssl | Ubuntu | trusty | * |
Openssl | Ubuntu | trusty/esm | * |
Openssl | Ubuntu | upstream | * |
Openssl | Ubuntu | xenial | * |
Openssl1.0 | Ubuntu | bionic | * |
Code frequently has to work with limited resources, so programmers must be careful to ensure that resources are not consumed too quickly, or too easily. Without use of quotas, resource limits, or other protection mechanisms, it can be easy for an attacker to consume many resources by rapidly making many requests, or causing larger resources to be used than is needed. When too many resources are allocated, or if a single resource is too large, then it can prevent the code from working correctly, possibly leading to a denial of service.
Assume all input is malicious. Use an “accept known good” input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, “boat” may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as “red” or “blue.”
Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code’s environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
Mitigation of resource exhaustion attacks requires that the target system either:
The first of these solutions is an issue in itself though, since it may allow attackers to prevent the use of the system by a particular valid user. If the attacker impersonates the valid user, they may be able to prevent the user from accessing the server in question.
The second solution can be difficult to effectively institute – and even when properly done, it does not provide a full solution. It simply requires more resources on the part of the attacker.
If the program must fail, ensure that it fails gracefully (fails closed). There may be a temptation to simply let the program fail poorly in cases such as low memory conditions, but an attacker may be able to assert control before the software has fully exited. Alternately, an uncontrolled failure could cause cascading problems with other downstream components; for example, the program could send a signal to a downstream process so the process immediately knows that a problem has occurred and has a better chance of recovery.
Ensure that all failures in resource allocation place the system into a safe posture.
Use resource-limiting settings provided by the operating system or environment. For example, when managing system resources in POSIX, setrlimit() can be used to set limits for certain types of resources, and getrlimit() can determine how many resources are available. However, these functions are not available on all operating systems.
When the current levels get close to the maximum that is defined for the application (see CWE-770), then limit the allocation of further resources to privileged users; alternately, begin releasing resources for less-privileged users. While this mitigation may protect the system from attack, it will not necessarily stop attackers from adversely impacting other users.
Ensure that the application performs the appropriate error checks and error handling in case resources become unavailable (CWE-703).