Question 220
A customer-support portal displays untrusted comments as HTML inside an agent dashboard, allowing script execution for reviewers. Which next step is most appropriate under the stated conditions?
Explanation
Correct Answer
Apply context-specific output encoding and a safe rendering policy. XSS prevention depends on the output context rather than blacklisted keywords.
Incorrect Answers
“Strip script tags while allowing event-handler attributes in rendered HTML” asserts more certainty than the records allow. Verify whether rendered comments remain inert text for both agents and customers.
The generalization “Add input-only encoding while rendering trusted-looking comments as raw markup” does not follow from the available artifacts. Filtering the string script alone misses alternative executable contexts.
“Remove only script-tag strings while continuing to render untrusted comments as HTML” excludes a plausible alternative without testing it. The source case reports that a customer-support portal displays untrusted comments as HTML inside an agent dashboard, allowing script execution for reviewers.