# Cyclos 4.14.7 - Dom-based Cross-Site Scripting (CVE-2021-31673)

### CVE-2021-31673 <a href="#cve-2021-31673" id="cve-2021-31673"></a>

**Date:** 17/04/2021

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

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

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

**Description:** A Dom-based Cross-site scripting (XSS) vulnerability at registration account in Cyclos 4 PRO.14.7 and before allows remote attackers to inject arbitrary web script or HTML via the groupId parameter.

**Steps to reproduce:** An attacker sends a draft URL *\[IP]/#users.users.public-registration!groupId=1%27%22%3E%3Cimg%20src=x%20onerror=alert(document.domain)%3E* to victim. When a victim opens the URL, XSS will be triggered.

### Thông tin bên lề về lỗ hổng

Cách đây một năm, trong khi tham gia một chương trình Bug bounty ở Whitehub, target mà chương trình mình tham gia sử dụng một Banking Software có tên là Cyclos. Sau khi xem sơ lược các chức năng chính, mình nhận thấy tại chức năng đăng ký tài khoản khi giá trị tham số groupId không tồn tại thì xuất hiện thông báo lỗi đính kèm giá trị groupId mà ta nhập vào.

![](/files/VO8TIMbVAXc8zldek0MX)

Vì thông báo lỗi có đính kèm giá trị mà ta nhập vào, rất có thể vị trí này tồn tại lỗ hổng XSS. Kiểm tra bằng cách chèn payload: `<img src=xxx onerror=alert(document.domain)>` vào tham số **groupId**

![Xác nhận lỗ hổng Dom-based XSS](/files/QCoNBd3noDTqEht8DGTk)

Để tìm source và sink của các lỗ hổng Dom-based XSS, ta sẽ chèn debugger vào payload và debug trên trình duyệt Chrome, xem thanh Call Stack, ta tìm được source và sink như sau:

**source:** location.hash tại cyclos.gwt-0.js1

```
function DGc() {
    var a;
    a = $wnd.location.hash;
    if (a == null || a.length == 0) {
        return ''
    }
    return JGc(a.substr(1))
}
```

![](/files/ObI0iUOwhFdQgZB6T0Ty)

**sink:** innerHTML tại cyclos.gwt-0.js1

```
function Ie(b, a) {
    b.innerHTML = a || ''
}
```

![](/files/3G5pWFYcMthwgJuus5EF)

Và sau 1 năm chờ đợi mình có đã CVE đầu tiên. Cảm ơn các bạn đã đọc bài viết.


---

# 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-cve-2021-31673.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.
