Question 520
A helpdesk dashboard embeds untrusted ticket comments into an HTML script context, and authorized tests execute JavaScript under the reviewing agent's session. What post-change result would most convincingly validate the intended risk reduction?
Explanation
Correct Answer
Test payloads render harmlessly while legitimate comments remain readable. This checks the risk-changing outcome, rather than showing only that a ticket closed. The decisive mechanism is that cross-site scripting prevention is determined by the output context. Compare the observed result to the initial evidence and preserve the test record.
Incorrect Answers
Stored comments pass server validation still permits execute in a reviewer browser. The actual failure or design condition is Untrusted output reaches an executable browser context without safe encoding.
The comment is stored successfully still permits injected code runs in the agent view. What the present question requires instead is Use context-specific encoding and safe templating for stored comments.
Browser script still runs from a comment still permits a generic input filter approved it. The source-specific test or observation is Test payloads render harmlessly while legitimate comments remain readable.