Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Users often assume that Java class files obtained from a trustworthy source will be conforming and, consequently, safe for execution. This belief can erroneously lead them to see bytecode verification as a superfluous activity for such classes. Consequently, they could disable bytecode verification, undermining Java's safety and security guarantees.

Noncompliant Code Example

The bytecode verification process runs by default. The -Xverify:none flag on the JVM command line suppresses the verification process. This noncompliant code example uses the flag to disable bytecode verification.

Code Block
bgColor#FFcccc
java -Xverify:none ApplicationName

Compliant Solution

Most JVM implementations perform bytecode verification by default; it is also performed during dynamic class loading.

...

Code Block
bgColor#ccccff
java -Xverify:all ApplicationName

Exceptions

ENV10-EX1: On Java 2 systems, the primordial class loader is permitted to omit bytecode verification of classes loaded from the boot class path. These system classes are protected through platform and file system protections, rather than by the bytecode verification process.

Risk Assessment

Bytecode verification ensures that the bytecode contains many of the security checks mandated by the Java Language Specification. Omitting the verification step could permit execution of unsafe Java code.

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

ENV10-J

high

likely

low

P27

L1

Automated Detection

Static checking of this rule is not feasible in the general case.

Related Vulnerabilities

Search for vulnerabilities resulting from the violation of this rule on the CERT website.

Bibliography

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="6e7a812f0ae1230d-2c0f6a2a-41304a1c-89e98636-939c2ab0a12751ad2b4b8fbd"><ac:plain-text-body><![CDATA[

[[Oaks 2001

AA. Bibliography#Oaks 01]]

The Bytecode Verifier

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="37778cfdcfa7a74b-ff0d00ee-4c614880-9ed8b4cd-2f3b689bd031c181c2432207"><ac:plain-text-body><![CDATA[

[[Pistoia 2004

AA. Bibliography#Pistoia 04]]

Section 7.3, The Class File Verifier

]]></ac:plain-text-body></ac:structured-macro>

...