SOC(セキュリティオペレーションセンター)は、ワークステーションから社内Webアプリケーションにアクセスする際に発生するデスクトップエラーメッセージが最近増加しているという苦情を多数受け取っています。アナリストは、Webサーバー上で最近変更されたXMLファイルを特定し、レビューのためにそのファイルのコピーを取得しました。そのファイルには、次のコードが含まれていました。

以下のXMLスキーマ制約のうち、これらのデスクトップエラーメッセージが表示されないようにするには、どれを使用すればよいでしょうか?
正解:B
The XML file containsJavaScript embedded within a < description > tagthat executes an alert message, which is a commonCross-Site Scripting (XSS)attack vector. The issue occurs becausethe XML schema does not restrict the input to safe characters, allowingarbitrary script executionwhen the XML file is processed by a vulnerable application.
Solution: Implement Input Validation Using an XML Schema Constraint
* Option Benforces awhitelist approachby allowingonly alphanumeric characters and spaces([a-zA-Z 0-9]
*).
* This prevents the inclusion ofmalicious JavaScript or special characterssuch as < , > , or & , which are required for XSS injection.
Why are the other options incorrect?
* Option A: Restricts input to aSocial Security Number (SSN) format ([0-9]{3}-[0-9] {2}-[0-9]{4}).
While it prevents JavaScript injection, it is too restrictive and would break legitimate text-based content in the XML.
* Option C: Restricts input toonly numeric values ([0-9]*), preventing JavaScript injection but also breaking legitimate non-numeric content in the < description > field.
* Option D: Restricts input to asingle positive integer, which does not align with the expected text-based content.
Thus,Option Bis the correct answer, as it enforces proper input validation while still allowing expected text input.