2019
Example Language: Java (Bad)
Long count = 0L;
for (long i = 0; i < Integer.MAX_VALUE; i++) {
count += i;
}
In the above loop, we see that the count variable is declared as a boxed primitive. This causes
autoboxing on the line that increments. This causes execution to be magnitudes less performant
(time and possibly space) than if the "long" primitive was used to declare the count variable, which
can impact availability of a resource.
Example 2:
This code uses primitive long which fixes the issue.
Example Language: Java (Good)
long count = 0L;
for (long i = 0; i < Integer.MAX_VALUE; i++) {
count += i;
}
MemberOf Relationships
This MemberOf relationships table shows additional CWE Catgeories and Views that reference this
weakness as a member. This information is often useful in understanding where a weakness fits
within the context of external information sources.
Nature Type ID Name Page
MemberOf 1416 Comprehensive Categorization: Resource Lifecycle
Management
1400 2545
Taxonomy Mappings
Mapped Taxonomy Name Node ID Fit Mapped Node Name
SEI CERT Oracle Coding
Standard for Java
EXP04-J Do not pass arguments to certain Java
Collections Framework methods that
are a different type than the collection
parameter type
ISA/IEC 62443 Part 4-1 Req SI-2
References
[REF-1051]"Oracle Java Documentation". < https://docs.oracle.com/javase/1.5.0/docs/guide/
language/autoboxing.html >.
[REF-1052]The Software Engineering Institute. "SEI CERT Oracle Coding Standard for Java : Rule
02. Expressions (EXP)". < https://wiki.sei.cmu.edu/confluence/display/java/EXP04-J.+Do+not+pass
+arguments+to+certain+Java+Collections+Framework+methods+that+are+a+different+type+than
+the+collection+parameter+type >.
CWE-1236: Improper Neutralization of Formula Elements in a CSV File
Weakness ID : 1236
Structure : Simple
Abstraction : Base
Description
CWE Version 4.14
CWE-1236: Improper Neutralization of Formula Elements in a CSV File
CWE-1236: Improper Neutralization of Formula Elements in a CSV File