Skip to content

Commit 8267e80

Browse files
committed
Minor Fixes and Added flag for XSS Challenge
1 parent 627cd60 commit 8267e80

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

vapi/app/Http/Controllers/StickyNotesController.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,20 @@ public function show(Request $request)
3434
{
3535
$sticky_notes= json_decode(json_encode(StickyNotes::all()),true);
3636

37+
$potential_xss_payload_flag = false;
3738
// Lazy XML Conversions Needs to be fixed
3839
$xml_output = "<xml>";
3940
foreach($sticky_notes as $note)
4041
{
4142
$xml_output = $xml_output."<note>".$note['note']."</note>";
43+
44+
if (Str::contains($note['note'],"<"))
45+
{
46+
$potential_xss_payload_flag=true;
47+
}
4248
}
4349

44-
if($format == "html" and (Str::contains($xml_output,"<script") or Str::contains($xml_output,"<img")) )
50+
if($format == "html" and $potential_xss_payload_flag)
4551
{
4652
$xml_output = $xml_output."<flag>".base64_decode(Variables::getXSSFlag())."</flag>";
4753
}

0 commit comments

Comments
 (0)