# CVE-2024-42365: Asterisk allows `Write=originate` as sufficient permissions for code execution / `System()` dialplan

> An Asterisk AMI user with originate permissions can modify configuration files to achieve remote code execution and privilege escalation.

- **Severity:** High 7.4 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 8 Aug 2024
- **Updated:** 3 Nov 2025
- **Also known as:** ALPINE-CVE-2024-42365, DEBIAN-CVE-2024-42365, GHSA-c4cg-9275-6w44, UBUNTU-CVE-2024-42365

## What is CVE-2024-42365?

CVE-2024-42365 is a high-severity vulnerability in asterisk, published on 8 Aug 2024. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

Asterisk is an open source private branch exchange (PBX) and telephony toolkit. Prior to asterisk versions 18.24.2, 20.9.2, and 21.4.2 and certified-asterisk versions 18.9-cert11 and 20.7-cert2, an AMI user with `write=originate` may change all configuration files in the `/etc/asterisk/` directory. This occurs because they are able to curl remote files and write them to disk, but are also able to append to existing files using the `FILE` function inside the `SET` application. This issue may result in privilege escalation, remote code execution and/or blind server-side request forgery with arbitrary protocol. Asterisk versions 18.24.2, 20.9.2, and 21.4.2 and certified-asterisk versions 18.9-cert11 and 20.7-cert2 contain a fix for this issue.

Weakness: CWE-267 (Privilege Defined With Unsafe Actions), CWE-1220 (Insufficient Granularity of Access Control)

## Which versions are affected by CVE-2024-42365?

It affects 2 products.


Products: Asterisk Asterisk, Asterisk Certified Asterisk.

## How do I fix CVE-2024-42365?

Upgrade to a fixed version.

## Is CVE-2024-42365 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-42365 exists.

Public exploit code:

- Asterisk AMI Originate Authenticated RCE (metasploit)
- Detailed design & exploitation writeup for Ringdown—an original Debian/Asterisk vulnerable machine featuring CVE-2024-42365 (AMI), PJSIP pre-hash cracking, and Fail2ban POSIX ACL privilege escalation. (github_poc): https://github.com/Raajgupta01/htb-machine-ringdown

## Other vulnerabilities in asterisk

- [CVE-2007-2488](https://insights.sbomify.com/CVE-2007-2488/): Null dereference in n/a (critical 10.0)
- [CVE-2008-1390](https://insights.sbomify.com/CVE-2008-1390/): Weak cryptography in n/a (critical 9.3)
- [CVE-2007-3762](https://insights.sbomify.com/CVE-2007-3762/): Memory corruption in n/a (critical 9.3)
- [CVE-2008-1332](https://insights.sbomify.com/CVE-2008-1332/): Auth bypass in n/a (high 8.8)
- [CVE-2008-3263](https://insights.sbomify.com/CVE-2008-3263/): Denial of service in n/a (high 7.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-42365 and fix it if it is affected.

What it is: CVE-2024-42365 is a high-severity vulnerability in asterisk, published on 8 Aug 2024. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-42365 exists.

Affected product: asterisk. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-42365/ (Markdown: https://insights.sbomify.com/CVE-2024-42365/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-42365
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-42365
- OSV: https://osv.dev/vulnerability/CVE-2024-42365

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-42365/
Summaries are generated and may contain mistakes; the official description above is the record.
