nerdexam
CompTIA

CS0-003 · Question #530

The SOC receives a number of complaints regarding a recent uptick in desktop error messages that are associated with workstation access to an internal web application. An analyst, identifying a…

The correct answer is B. <xs:element name="firstIntro"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:pattern value="[a-zA-Z 0-9]*"/> </xs:restriction> </xs:simpleType> </xs:element>. Option B is correct because it defines an XML schema restriction on the 'firstIntro' element using a pattern that allows alphanumeric characters and spaces ([a-zA-Z 0-9]*), which is the most permissive and broadly applicable validation pattern for a typical web application…

Submitted by mike_84· Mar 6, 2026Security Operations / Threat and Vulnerability Management - Understanding how improper input validation in XML configurations can cause application errors and how XML schema constraints (XSD) can enforce data integrity to mitigate these issues (CompTIA CySA+ or Security+ Domain: Software and Systems Security / Incident Response)

Question

The SOC receives a number of complaints regarding a recent uptick in desktop error messages that are associated with workstation access to an internal web application. An analyst, identifying a recently modified XML file on the web server, retrieves a copy of this file for review, which contains the following code:

Which of the following XML schema constraints would stop these desktop error messages from appearing? A. B. C. D.

Exhibits

CS0-003 question #530 exhibit 1
CS0-003 question #530 exhibit 2
CS0-003 question #530 exhibit 3
CS0-003 question #530 exhibit 4
CS0-003 question #530 exhibit 5

Options

  • A<xs:element name="firstIntro"> xs:simpleType <xs:restriction base="xs:token"> <xs:pattern value="[0-9]{3}-[0-9]{2}-[0-9]{4}"/> </xs:restriction> </xs:simpleType> </xs:element>
  • B<xs:element name="firstIntro"> xs:simpleType <xs:restriction base="xs:string"> <xs:pattern value="[a-zA-Z 0-9]*"/> </xs:restriction> </xs:simpleType> </xs:element>
  • C<xs:element name="firstIntro"> xs:simpleType <xs:restriction base="xs:string"> <xs:pattern value="[0-9]*"/> </xs:restriction> </xs:simpleType> </xs:element>
  • D<xs:element name="firstIntro"> xs:simpleType <xs:restriction base="xs:positiveInteger"/> <xs:pattern value="[0-9]"/> </xs:restriction> </xs:simpleType> </xs:element>

How the community answered

(29 responses)
  • A
    10% (3)
  • B
    62% (18)
  • C
    21% (6)
  • D
    7% (2)

Explanation

Option B is correct because it defines an XML schema restriction on the 'firstIntro' element using a pattern that allows alphanumeric characters and spaces ([a-zA-Z 0-9]*), which is the most permissive and broadly applicable validation pattern for a typical web application input field like a name or introduction field. This constraint ensures that only safe, expected characters are accepted, preventing malformed or malicious input that could cause desktop error messages when the XML is parsed. By enforcing input validation at the schema level, the application receives well-formed data that it can process without generating errors.

Topics

#XML Schema Validation#Input Validation#Web Application Security#XSD Constraints

Community Discussion

No community discussion yet for this question.

Full CS0-003 Practice