Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Restrictions on what an unsigned Java applet can do?

I'm trying to compile a complete list of all restrictions placed on unsigned Java applets (defined as things a normal Java application can do, but an unsigned Java applet cannot).

This is the list I've compiled so far:

An unsigned Java applet ...

  1. Cannot access the local filesystem.
    • Cannot access the system clipboard.
    • Cannot initiate a print job.
    • Cannot connect to or retrieve resources from any third party server (any server other than the server the applet originated from).
    • Cannot use multicast sockets.
    • Cannot create or register a SocketImplFactory, URLStreamHandlerFactory, or ContentHandlerFactory.
    • Cannot listen to incoming socket connections.
    • Cannot listen for datagrams.
    • Cannot access some of the system properties (java.class.path, java.home, user.dir, user.home, user.name).
    • Cannot create or register a SecurityManager object.
    • Cannot dynamically load native code libraries with the load() or loadLibrary() methods of Runtime or System.
    • Cannot spawn new processes by calling any of the Runtime.exec() methods.
    • Cannot create or access threads or thread groups outside of the thread group in which the untrusted code is running.
    • Cannot define classes in java.*, sun.* and netscape.*.
    • Cannot explicitly load classes from the sun.* package.
    • Cannot exit the Java runtime by calling System.exit() or Runtime.exit().
    • Cannot access the system event queue.
    • Cannot use the java.lang.Class reflection methods to obtain information about nonpublic members of a class, unless the class was loaded from the same host as the untrusted code.
    • Cannot manipulate security identities in any way (java.security).
    • Cannot set or read security properties (java.security).
    • Cannot list, look up, insert, or remove security providers (java.security).

Question: Are there any restrictions missing? If so, please clearly state what restriction you believe is missing from the list.

like image 887
knorv Avatar asked Sep 27 '09 13:09

knorv


People also ask

What are the restrictions imposed on Java applets?

An applet cannot load libraries or define native methods. An applet cannot ordinarily read or write files on the execution host. An applet cannot read certain system properties. An applet cannot make network connections except to the host that it came from.

Why there are so many restrictions in applet programming?

Applets have many restrictions over the areas of security because they are obtained from remote machines and can harm client-side machines.

What are the security issues related to Java applets?

There is a security model for Java applets that has two rules: Applets may communicate only with the Web server from which they were downloaded. Applets may not have access to local resources, such as files, the clipboard and printer ports, on a workstation to which they are downloaded.


2 Answers

See this from Sun's tutorial: What Applets Can and Cannot Do.

like image 92
Jesper Avatar answered Sep 30 '22 19:09

Jesper


Also you cannot register an UncaughtExceptionHandler.

like image 32
fury Avatar answered Sep 30 '22 19:09

fury