A computer-implemented method for cyber security, the method comprising:
- receiving, by an application capable of JavaScript execution, code for execution;
- before execution of input code by a JavaScript-enabled application, running an intercepting code, wherein the intercepting code is configured to intercept at least one application programming interface (API) invocation of the input code;
- intercepting, by the intercepting code, an API invocation of the input code;
- determining that the intercepted API invocation results in a manipulation of a backing store object;
- and
- modifying an execution of the intercepted API invocation, wherein:
- modifying the execution of the intercepted API invocation includes at least one of:
- padding input data associated with the API invocation;
- encoding input data associated with the API invocation;
- manipulating input data associated with the API invocation;
- splitting, into multiple execution contexts, input data associated with the API invocation;
- or changing object shape information, and
- the modified execution results in a nonpredictable environment state.