Client Side Vulnerabilities / JavaScript Execution
Description
JavaScript Execution is a type of Client Side Vulnerability that occurs in Web and API applications. It refers to the ability of malicious code to be injected into the application and executed on the client-side. It is a type of code injection attack and is classified by the Common Weakness Enumeration (CWE) directory as CWE-95: Improper Control of Generation of Code. The OWASP Testing Guide also categorizes this as an Injection Flaw.
Risk
JavaScript Execution vulnerabilities present a significant risk to applications. Malicious code can be injected into the application and executed on the client-side, allowing attackers to bypass server-side security measures. The malicious code can be used to gain access to data, modify the application’s code, or interfere with the application’s functionality.
Solution
The best way to prevent JavaScript Execution vulnerabilities is to ensure that all user-supplied input is validated and sanitized before being used in the application. All user-supplied input should be carefully checked for malicious code before being used in the application. Additionally, all JavaScript code should be obfuscated and minified to make it more difficult for attackers to inject malicious code.
Example
An example of a JavaScript Execution vulnerability is CVE-2019-2725. This vulnerability exists in the Oracle WebLogic Server component of Oracle Fusion Middleware. The vulnerability allows an unauthenticated attacker to inject arbitrary JavaScript code into the web application, which can then be executed by the application on the client-side.