CAS-003 · Question #854
A security analyst is examining threats with the following code function: Which of the following threats should the security analyst report?
The correct answer is E. There is unsafe execution of third-party JavaScript code. The code function contains unsafe execution of third-party JavaScript, which exposes the application to injection and cross-site scripting attacks.
Question
A security analyst is examining threats with the following code function:
Which of the following threats should the security analyst report?
Exhibit
Options
- APOST should be used instead of GET when making requests.
- BRoot privileges are needed for the service to bind to the privileged port 8443.
- CThe website allows unauthorized access to sensitive resources.
- DThe web server allows insecure cookie storage.
- EThere is unsafe execution of third-party JavaScript code.
How the community answered
(35 responses)- A3% (1)
- B6% (2)
- C11% (4)
- D3% (1)
- E77% (27)
Why each option
The code function contains unsafe execution of third-party JavaScript, which exposes the application to injection and cross-site scripting attacks.
Using GET for operations that modify server state is a design concern, but it does not represent a direct code-level execution vulnerability of comparable severity to unsafe script execution.
Port 8443 is not a privileged port - privileged ports are those numbered below 1024 - so binding to port 8443 does not require root privileges and is not a security threat.
Unauthorized access to sensitive resources reflects an access-control misconfiguration and would not be directly identifiable from a code function signature without additional context.
Insecure cookie storage, such as missing HttpOnly or Secure flags, is a separate configuration-level concern that is distinct from code that unsafely executes external scripts.
Unsafe execution of third-party JavaScript - through mechanisms such as eval(), document.write(), or dynamic script loading from untrusted sources - allows an attacker to inject and run arbitrary code within the application's security context. This can result in session hijacking, credential theft, or full application compromise, and is classified under OWASP's injection and XSS vulnerability categories. Executing unvalidated external JavaScript is one of the most critical code-level security risks in web and hybrid mobile applications.
Concept tested: Unsafe third-party JavaScript execution and XSS risk
Source: https://owasp.org/www-community/attacks/xss/
Topics
Community Discussion
No community discussion yet for this question.
