1. A method of preventing unwanted code execution, the method comprising: identifying, by the computer system, at risk portions of an associated scripting environment, wherein a portion of the associated scripting environment comprises any instance of the functions, objects and properties of the associated scripting environment; identifying, by the computer system, at least one trusted server-side resource; receiving trusted and untrusted scripts by the computer system, wherein trusted refers to responses received from the trusted server-side resource, and untrusted refers to responses received from other external script sources; receiving from the trusted server-side resource at least one further message containing one or more passwords; and preventing, by the computer system, unwanted code execution by: re-writing said at risk portions of the associated scripting environment to require presentation of the one or more passwords in order to execute.