| Wiki Markup |
|---|
The CERT Oracle Secure Coding Standard for Java focuses on the Java SEStandard Edition 6 Platform (Java SE 6) environment and includes rules that address the issue of for secure coding using the Java SEprogramming language 6and APIlibraries. The Java Language Specification (3rd edition) \[[JLS 2005|AA. Bibliography#JLS 05]\] prescribes the behavior of the Java programming language and servesserved as the primary reference for the development of this standard. This coding standard also addresses new features of the Java SE 7 Platform. Primarily, these features provide alternative compliant solutions to secure coding problems whichthat exist in both the Java SE 6 and Java SE 7 platforms. The following rules provide Java SE 7 Platform specific compliant solutions: |
| Content by Label | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Traditional languages Languages such as C and C++ allow undefined, unspecified, or implementation-defined behavior behaviors, which leads can lead to vulnerabilities when a programmer makes incorrect assumptions about the underlying behavior of an API or language construct. The Java Language Specification , on the other hand, standardizes goes further to standardize language requirements where possible, because Java is designed to be a cross platform "write once, run anywhere" language. Even then, certain behaviors are left to the discretion of the implementer implementor of the Java Virtual Machine (JVM) or the Java compiler. This standard identifies such language peculiarities and suggests solutions to help the implementers address the issues and let programmers appreciate and understand the limitations of the language and navigate around demonstrates secure coding practices to avoid them.
Focusing only on language issues does not translate to writing secure software. Design issues flaws in Java application programming interfaces (APIs) sometimes lead to their deprecation. At other times, the APIs or the relevant documentation may be interpreted incorrectly by the programming community. This standard identifies such problematic APIs and highlights their correct use. Examples of commonly used faulty design patterns (anti-patterns) and idioms are also included.
The Java language, its core and extension APIs, and the Java Virtual Machine ( JVM ) provide several security features , such as , the security manager and , access controller, cryptography, automatic memory management, strong type checking, and byte code bytecode verification. These features provide sufficient security for most applications, but their proper use is of paramount importance. This standard highlights the pitfalls and caveats associated with the security architecture and stresses on its correct implementation. Adherence to this standard safeguards trusted programs from a plethora of exploitable security bugs that can cause denial of servicethe confidentiality, integrity, and availability (CIA) of trusted programs and helps eliminate exploitable security flaws that can result in denial-of-service attacks, time-of-check-to-time-of-use attacks, information leaks, erroneous computations, and privilege escalation.
A section dedicated to securing the runtime environment helps enforce many of the guidelines. Software that complies with this standard provides its users the ability to define fine-grained security policies and safely execute trusted mobile code on an untrusted systemuntrusted systems or untrusted mobile code on trusted systems.
Included Libraries
This secure coding standard addresses security issues primarily applicable to the lang and util base libraries, as well as for "other base libraries"to the Collections, Concurrency Utilities, Logging, Management, Reflection, Regular Expressions, Zip, I/O, JMX, JNI, Math, Serialization, and XML JAXP libraries. This standard avoids the inclusion of open bugs that have already been marked to be fixed or those that do not have any lack security ramifications. A functional bug is only included if when it is likely that it occurs with high frequency, causes considerable security concerns, or affects most Java technologies that rely on the core platform. This standard is not limited to security issues specific to the Core API but also includes important security concerns pertaining to the standard extension APIs (javax package).
Issues not Addressed
There are a number of issues The following issues are not addressed by this standard:
*Design and Architecture. This standard assumes that the design and architecture of the product is secure, that is, that the product is free of design-level vulnerabilities that would otherwise compromise its security.
*Content.This coding standard does not address concerns specific to only one Java-based platform but applies broadly to all platforms. For example, rules that are applicable to Java Micro Edition (ME) or Java Enterprise Edition (EE) alone and not to Java SE are typically not included. Within Java SE, APIs that deal with the user interface (User Interface Toolkits) or with the web interface for providing features such as sound, graphical rendering, user account access control, session management, authentication, and authorization are beyond the scope of this standard. However, this does not preclude the standard from discussing networked Java systems given the risks associated with improper input validation and injection flaws and suggesting appropriate mitigation strategies.
*Coding Style.Coding style issues are subjective; it has proven impossible to develop a consensus on appropriate style rules. Consequently, The CERT Oracle Secure Coding Standard for Java recommends only that the user define style rules and apply those rules consistently; requirements that mandate use of any particular coding style are deliberately omitted. The easiest way to consistently apply a coding style is with the use of a code formatting tool. Many integrated development environments (IDEs) provide such capabilities.
*Tools.As a federally funded research and development center (FFRDC), the Software Engineering Institute (SEI) is not in a position to recommend particular vendors or tools to enforce the restrictions adopted. Users of this document are free to choose tools; vendors are encouraged to provide tools to enforce these rules.
*Controversial Rules.In general, the CERT secure coding standards try to avoid the inclusion of controversial rules that lack a broad consensus.
Content
This coding standard does not address concerns specific to only one Java based platform, but applies broadly to all platforms. For example, guidelines that are applicable to Java ME or Java EE alone and not to Java SE are typically not included. Within Java SE, APIs that deal with the the user interface (User Interface Toolkits) or the web interface for providing features such as sound, graphical rendering, user account access control, session management, authentication and authorization, are beyond the scope of this standard. However, this does not preclude the standard from discussing networked Java systems in light of the risks associated with improper input validation and injection flaws, and suggesting appropriate mitigation strategies. This standard assumes that the functional specification of the product correctly identifies and prevents higher level design and architectural vulnerabilities.
...
