> For the complete documentation index, see [llms.txt](https://kos0ng.gitbook.io/notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kos0ng.gitbook.io/notes/research/2023/cve-2023-0046.md).

# CVE-2023-0046

## Vulnerability Explanation

This vulnerability occur because there is no filename **restriction** or **validation** during file **logging** saving process. In this case attacker can set the filename to existing **php** file and append **php code** on it by manipulating the logged input.

## Vulnerability Type

* Code Injection

## CVSS <a href="#user-content-attack-vector" id="user-content-attack-vector"></a>

* [CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H](https://nvd.nist.gov/vuln/detail/CVE-2023-0046) (High)&#x20;

## Vendor <a href="#user-content-vendor-of-product" id="user-content-vendor-of-product"></a>

* [daloRADIUS](https://www.daloradius.com/)

## Affected Version <a href="#user-content-affected-version" id="user-content-affected-version"></a>

* daloRADIUS **<= 1.3**

## Proof of Concept <a href="#user-content-steps-to-reproduce" id="user-content-steps-to-reproduce"></a>

1. Log in using operator account, in this case i try to login using **operator1** user which is account that i created with **ACL** Settings only **rep\_online** enabled
2.

```
<figure><img src="/files/LIyjlKNm83nIMZMNB4MJ" alt=""><figcaption></figcaption></figure>
```

3. Go to config and click on logging settings. Modify filename to any php file that accessible , e.g **update.php** then enabled **`Logging of Queries`**`.`
4.

```
<figure><img src="/files/xeGfeJOCLkf4e8sKPTfY" alt=""><figcaption></figcaption></figure>
```

5. Go to **rep\_online** feature and fill the `username` with **php code**, e.g `phpinfo()`
6.

```
<figure><img src="/files/5TbJpd1ptQ4y22ZtS0Wd" alt=""><figcaption></figcaption></figure>
```

7. Go to **update.php** and you will see that `phpinfo()` successfully injected
8.

```
<figure><img src="/files/NLRKo3tdBJIXWerhB6U5" alt=""><figcaption></figcaption></figure>
```

## Exploit Code <a href="#user-content-exploit-code" id="user-content-exploit-code"></a>

```python
# TBU
```

## Tested On <a href="#user-content-tested-on" id="user-content-tested-on"></a>

* daloRADIUS version: **1.3**

## Disclosure Timeline <a href="#user-content-disclosure-timeline" id="user-content-disclosure-timeline"></a>

* **2023-01-03:** Vulnerability discovered.
* **2023-01-04:** Vulnerability fixed.
* **2023-01-04:** Vulnerability reported to the MITRE corporation.
* **2023-01-04:** CVE has been assigned.
* **2023-01-04:** Public disclosure of the vulnerability.

## Researcher <a href="#user-content-discoverer" id="user-content-discoverer"></a>

* Achmad Zaenuri Dahlan Putra ([kos0ng](https://github.com/kos0ng))

## Additional Information <a href="#user-content-reference" id="user-content-reference"></a>

* <https://huntr.com/bounties/2214dc41-f283-4342-95b1-34a2f4fea943/>
* <https://github.com/lirantal/daloradius/commit/2013c2d1231e99dac918247b69b198ded1f30a1c>
