File tree Expand file tree Collapse file tree
dvws-svelte/src/routes/(app)/admin/users Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616 responseMessage = ' ' ;
1717
1818 try {
19- // VULN: No CSRF token
20- // Training objective: CSRF on privileged operation
2119 const { data } = await apiClient .post (' /api/v2/admin/create-user' ,
2220 JSON .stringify ({ username , password , admin: isAdmin }),
2321 { headers: { ' Content-Type' : ' application/json' }}
2422 );
2523
26- // VULN: Unescaped response
2724 responseMessage = ` User ${username } created successfully! ` ;
2825 username = ' ' ;
2926 password = ' ' ;
7168
7269 {#if responseMessage }
7370 <div class =" mt-4 p-3 bg-blue-50 border border-blue-200 rounded" >
74- <!-- VULN: Unescaped response message -->
7571 {@html responseMessage }
7672 </div >
7773 {/if }
Original file line number Diff line number Diff line change 4242 </soapenv:Body>
4343</soapenv:Envelope> ` ;
4444
45- // VULN: SOAP XML Injection - backend may decode and re-inject
4645 const { data } = await apiClient .post (' /dvwsuserservice' , soapEnvelope , {
4746 headers: { ' Content-Type' : ' text/xml' }
4847 });
5150 const parser = new DOMParser ();
5251 const xmlDoc = parser .parseFromString (data , ' text/xml' );
5352
54- // VULN: Takes first match (.eq(0) equivalent)
55- // If attacker injects additional fields, this takes the injected ones first
5653 const usernameEl = xmlDoc .getElementsByTagName (' username' )[0 ];
5754 const roleEl = xmlDoc .getElementsByTagName (' role' )[0 ];
5855 const statusEl = xmlDoc .getElementsByTagName (' status' )[0 ];
8279 <div >
8380 <label class =" block text-sm font-medium mb-2" >Username</label >
8481 <Input bind:value ={username } placeholder =" Enter username to check" required />
85- < p class = " text-xs text-yellow-600 mt-1 " >⚠️ VULN: SOAP XML Injection possible</ p >
82+
8683 </div >
8784
8885 <div class =" flex gap-2" >
You can’t perform that action at this time.
0 commit comments