The invention relates to method for secure interpretation of a program in
an electronic device. An interpreted program is loaded and a stub
executable is formed using a prototype stub executable. The stub
executable is associated with the interpreted program. At least one
second capability also is assigned to the interpreted program and further
to the stub executable. The stub executable invokes at least one function
in a shared interpreter library to interpret the interpreted program. An
interpreter engine checks whether the interpreted program refers an
external interpreted program code section. The interpreter engine infers
at least one second capability for the external interpreted program code
section. The interpreter engine disallows the execution of said external
interpreted program code section if said at least one first capability is
not a subset of said at least one second capability.