Mobile code

Code fetched from a remote source and run on a local system without explicit installation, such as script in a web page, and controlled mainly by sandboxing and code signing.

Mobile code is software that travels across a network and runs on the receiving system, usually without the user installing anything. JavaScript in a web page is the everyday example; older forms include Java applets, ActiveX controls and Flash content. NIST SP 800-53 Rev. 5 has a dedicated control, SC-18 Mobile Code, which asks an organisation to define acceptable and unacceptable mobile code and to authorise, monitor and control its use.

The risk is that code written by someone else runs with the user’s privileges. Sandboxing confines the code so that it is kept from reaching the file system and other resources outside its boundary. Code signing identifies the publisher and lets the user or a policy decide whether to trust it, which was the ActiveX model. A signature shows origin and integrity, not that the code is safe. Mobile code is also the vehicle for cross-site scripting, where an attacker’s script runs in a victim’s browser under a trusted site’s origin.

Exam relevance: a scenario is likely to describe a script or plug-in that ran from a website and harmed the client. Candidates are expected to distinguish sandboxing, which limits what code can do, from code signing, which says who published it, and to recognise that signed code can still be malicious.