2 MIDP security features
One of the main benefits of MIDP is the openness of the platform, which enables anybody to write software
that can run on MIDP devices. MIDlet suites can be downloaded from the network in an anonymous fashion,
and as such, there are some security and privacy issues that the user may be concerned about: Can a MIDlet
read private data and send it to an unknown server? Can it make unauthorized calls that cost money to the
user? Can rogue programs run on the device and potentially cause problems?
Besides the Java language safety features, such as garbage collection and array bounds checking, the MIDP
specification adds some additional safety measures. In MIDP version 2.0, the security model allows MIDlets
access APIs that are considered sensitive. For example, making an HTTP connection is one of such sensitive
operations because it may involve monetary costs for the user. MIDP 2.0 includes the concept of trusted
and
untrusted
MIDlets.
• An
untrusted
MIDlet suite has limited access to restricted APIs, requiring user approval depending on
the security policy of the device.
• A
trusted
MIDlet suite can acquire some permissions automatically depending on the security policy.
Permissions are used to protect APIs that are sensitive and require authorization. The MIDP 2.0
implementation has to check whether a MIDlet suite has acquired the necessary permission before invoking
the API. Permissions have names starting with the package name in the same way as Java™ Standard Edition
(Java SE™) platform permissions. For instance, the permission to make an HTTP connection is called
javax.microedition.io.Connector.http. For available permissions, see the class or package
documentation of the protected API.
2.1 Protection Domains
Protection domains is a key security concept in MIDP 2.0. A protection domain is a set of permissions and
interaction modes. Those permissions can be either automatically granted or deferred until user approval.
They are called
allowed
and
user
permissions respectively. When a MIDlet suite is installed, it is assigned
to a given protection domain and acquires its permissions and interaction modes.
User
permissions may require an explicit approval by the user. The user can either deny the permission or
allow it. There are three interaction modes in which
user
permissions can be granted:
•
blanket
When the
blanket
interaction mode is used, the MIDlet suite acquires the permission as long as the suite
is installed, unless explicitly revoked by the user.
•
session
The
session
mode requests the user authorization the first time the API is invoked and its validity is
guaranteed while any of the MIDlets in the same suite are running.
•
oneshot
Oneshot
permissions request user approval every time the API is invoked. The protection domain
determines which of the modes are available for each user permission as well as the default mode.
A MIDlet suite has to request permissions declaratively using the
MIDlet-Permissions
and
MIDlet-
Permissions-Opt
attributes, either in the application descriptor or in the manifest file. MIDlet-Permissions
contains permissions that are critical for the suite's functionality and MIDlet-Permissions-Opt indicates
desired permissions, which are not so fundamental for the core functionality. For example, for an
application's functionality it is critical to make HTTP connections to work. It may also use HTTPS connections
for improved security, but it is not so vital. In this case, the application descriptor could look like this:
MIDlet-Permissions: javax.microedition.io.Connector.http
MIDlet-Permissions-Opt: javax.microedition.io.Connector.https
One of the requirements to install a MIDlet and assign it to a given domain is that the requested permissions
should be a subset of the permissions given to the protection domain. As an example, the S60 MIDP Emulator
Prototype 2.0 (SDK) includes a domain called
minimum
, which has no permissions at all. If a signed MIDlet
Forum.Nokia.com
MIDP 2.0: Signed MIDlet Developer's Guide 7