CWE

Common Weakness Enumeration

A Community-Developed List of Software Weakness Types

CWE/SANS Top 25 Most Dangerous Software Errors
Home > CWE List > CWE- Individual Dictionary Definition (3.0)  
ID

CWE-780: Use of RSA Algorithm without OAEP

Weakness ID: 780
Abstraction: Variant
Structure: Simple
Status: Incomplete
Presentation Filter:
+ Description
The software uses the RSA algorithm but does not incorporate Optimal Asymmetric Encryption Padding (OAEP), which might weaken the encryption.
+ Extended Description
Padding schemes are often used with cryptographic algorithms to make the plaintext less predictable and complicate attack efforts. The OAEP scheme is often used with RSA to nullify the impact of predictable common text.
+ Relationships

The table(s) below shows the weaknesses and high level categories that are related to this weakness. These relationships are defined as ChildOf, ParentOf, MemberOf and give insight to similar items that may exist at higher and lower levels of abstraction. In addition, relationships such as PeerOf and CanAlsoBe are defined to show similar weaknesses that the user may want to explore.

+ Relevant to the view "Research Concepts" (CWE-1000)
+ Relevant to the view "Architectural Concepts" (CWE-1008)
NatureTypeIDName
MemberOfCategoryCategory1013Encrypt Data
+ Relevant to the view "Development Concepts" (CWE-699)
NatureTypeIDName
MemberOfCategoryCategory310Cryptographic Issues
+ Modes Of Introduction

The different Modes of Introduction provide information about how and when this weakness may be introduced. The Phase identifies a point in the software life cycle at which introduction may occur, while the Note provides a typical scenario related to introduction during the given phase.

PhaseNote
Architecture and Design
ImplementationREALIZATION: This weakness is caused during implementation of an architectural security tactic.
+ Common Consequences

The table below specifies different individual consequences associated with the weakness. The Scope identifies the application security area that is violated, while the Impact describes the negative technical impact that arises if an adversary succeeds in exploiting this weakness. The Likelihood provides information about how likely the specific consequence is expected to be seen relative to the other consequences in the list. For example, there may be high likelihood that a weakness will be exploited to achieve a certain impact, but a low likelihood that it will be exploited to achieve a different impact.

ScopeImpactLikelihood
Access Control

Technical Impact: Bypass Protection Mechanism

Without OAEP in RSA encryption, it will take less work for an attacker to decrypt the data or to infer patterns from the ciphertext.
+ Likelihood Of Exploit
Medium
+ Demonstrative Examples

Example 1

The example below attempts to build an RSA cipher.

(bad)
Example Language: Java 
public Cipher getRSACipher() {
Cipher rsa = null;
try {
rsa = javax.crypto.Cipher.getInstance("RSA/NONE/NoPadding");

}
catch (java.security.NoSuchAlgorithmException e) {
log("this should never happen", e);

}
catch (javax.crypto.NoSuchPaddingException e) {
log("this should never happen", e);

}
return rsa;

}

While the previous code successfully creates an RSA cipher, the cipher does not use padding. The following code creates an RSA cipher using OAEP.

(good)
Example Language: Java 
public Cipher getRSACipher() {
Cipher rsa = null;
try {
rsa = javax.crypto.Cipher.getInstance("RSA/ECB/OAEPWithMD5AndMGF1Padding");

}
catch (java.security.NoSuchAlgorithmException e) {
log("this should never happen", e);

}
catch (javax.crypto.NoSuchPaddingException e) {
log("this should never happen", e);

}
return rsa;

}
+ Notes

Maintenance

This entry could probably have a new parent related to improper padding, however the role of padding in cryptographic algorithms can vary, such as hiding the length of the plaintext and providing additional random bits for the cipher. In general, cryptographic problems in CWE are not well organized and further research is needed.
+ References
[REF-694] Ronald L. Rivest and Burt Kaliski. "RSA Problem". 2003-12-10. <http://people.csail.mit.edu/rivest/RivestKaliski-RSAProblem.pdf>.
[REF-695] "Optimal Asymmetric Encryption Padding". Wikipedia. 2009-07-08. <http://en.wikipedia.org/wiki/Optimal_Asymmetric_Encryption_Padding>.
+ Content History
Submissions
Submission DateSubmitterOrganizationSource
2009-07-08Fortify Software
Based on information from Fortify Software.
Modifications
Modification DateModifierOrganizationSource
2011-06-01CWE Content TeamMITRE
updated Common_Consequences
2017-11-08CWE Content TeamMITRE
updated Modes_of_Introduction, References, Relationships

More information is available — Please select a different filter.
Page Last Updated: November 14, 2017