Exploiting XXE via image file upload
after mapping the website we find a file upload in the post comment functionnality
this application allows users to upload images, and process or validate these on the server after they are uploaded. Even if the application expects to receive a format like PNG or JPEG, the image processing library that is being used might support SVG images. Since the SVG format uses XML, we can submit a malicious SVG image and so reach hidden attack surface for XXE vulnerabilities.
let's create an svg image that contains XML payload to retrieve the /etc/hostname file from the application's server
now let's upload this file
after clicking on post comment
click on back to blog to see the svg image we have uploaded in the comment section
right click on this svg image and click on open in new tab
submit the server hostname data and we have solved the lab
hope you found this walkthrough easy to understand and follow
Greeting From Sayonara
Last updated
Was this helpful?