# CVE-2023-38964

## Introduction

I was searching for an LMS (Learning Management System), which is like a CMS (Content Management System) but specifically designed for managing courses. During my search, I came across "**Academy LMS 6.0"**. I purchased this product and decided to test it for vulnerabilities before uploading my courses and deploying it on my site.

## Code Analysis

At **application > controllers > Home.php**, on line 855, we found the search function, and on lines **858 - 865**, it is checked for XSS payloads.

<figure><img src="https://418865174-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFu6uaU65JuQBpnFAUDk8%2Fuploads%2FyAOwWL97Hek2q5nVFVhx%2FScreenshot%202023-08-03%20at%2019.33.49.png?alt=media&#x26;token=a4bf3482-6e9d-4cd8-94d0-3aac6294048f" alt=""><figcaption><p>Vulnerable Code</p></figcaption></figure>

These checks only if **$\_GET\['query']** contains **"** and **script** string.

## Attack

Intercepting **query** request with burp:

<figure><img src="https://418865174-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFu6uaU65JuQBpnFAUDk8%2Fuploads%2FcAfkYQLHWENMIL5pJrmk%2FScreenshot%202023-08-03%20at%2019.50.54.png?alt=media&#x26;token=2c468fcf-1389-4abd-a614-cdc4e6e47ada" alt=""><figcaption><p>Request</p></figcaption></figure>

"**TESTT**" is reflected in source code:

<figure><img src="https://418865174-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFu6uaU65JuQBpnFAUDk8%2Fuploads%2FYLLlQzWaXh6VkVZvN0DH%2FScreenshot%202023-08-03%20at%2019.52.49.png?alt=media&#x26;token=a132b19e-fa61-49f7-acec-169e53aaa24c" alt=""><figcaption><p>Reflect on the page</p></figcaption></figure>

We have two vectors for attack:

1. Weak verification
2. Input reflect on the page

Go test the following payload:

```
"><svg+onload=alert(1)>
```

<figure><img src="https://418865174-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFu6uaU65JuQBpnFAUDk8%2Fuploads%2FxybkpXAeInuoQu39YmVJ%2FScreenshot%202023-08-03%20at%2019.56.47.png?alt=media&#x26;token=672b31cf-624e-478e-b79a-b7f27d0b4a57" alt=""><figcaption><p>XSS Payload</p></figcaption></figure>
