Check mechanism for Java code security

Source: Internet
Author: User

Java code Security check mechanism :

First, the class loader is responsible for loading the class file (. class file) into the Java Virtual machine (JVM), which adds security by distinguishing between classes on the local file system and classes imported by the network system. This can limit any Trojan horse program. Because the native class is always loaded first, once all the classes are loaded, the memory of the execution file is fixed.

The bytecode Checker then verifies that the bytecode verifier does not check the class files generated by the trusted compilers, but instead examines the class files that intentionally violate the namespace rules and Java language rules, and closes the class file with a security vulnerability. Self Code checker mainly performs the following checks.

The loaded class conforms to the JVM specification's class file format, does not violate the access restrictions, does not cause overflow or underflow on the code, the parameter types of all operation codes are correct, no illegal data type conversions occur, and checks for the existence of certain illegal operations on the class file. The bytecode checker executes a sequence of try-catch-finally statements in a Java source program and captures and responds to Java program errors.

Finally, if the bytecode check is passed, the Java interpreter is responsible for interpreting the class file as machine code for execution.

Check mechanism for Java code security

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.