{"id":"CVE-2024-42365","published":"2024-08-08T16:29:07Z","modified":"2025-11-03T22:04:48Z","title":"Asterisk allows `Write=originate` as sufficient permissions for code execution / `System()` dialplan","vendor":"asterisk","product":"asterisk","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.4,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:L","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.04703,"percentile":0.92022,"provenance":"source"},"cwes":[{"id":"CWE-267","name":"Privilege Defined With Unsafe Actions"},{"id":"CWE-1220","name":"Insufficient Granularity of Access Control"}],"references":[{"url":"https://github.com/asterisk/asterisk/security/advisories/GHSA-c4cg-9275-6w44","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/asterisk/asterisk/commit/42a2f4ccfa2c7062a15063e765916b3332e34cc4","tags":["x_refsource_MISC"]},{"url":"https://github.com/asterisk/asterisk/commit/7a0090325bfa9d778a39ae5f7d0a98109e4651c8","tags":["x_refsource_MISC"]},{"url":"https://github.com/asterisk/asterisk/commit/b4063bf756272254b160b6d1bd6e9a3f8e16cc71","tags":["x_refsource_MISC"]},{"url":"https://github.com/asterisk/asterisk/commit/bbe68db10ab8a80c29db383e4dfe14f6eafaf993","tags":["x_refsource_MISC"]},{"url":"https://github.com/asterisk/asterisk/commit/faddd99f2b9408b524e5eb8a01589fe1fa282df2","tags":["x_refsource_MISC"]},{"url":"https://github.com/asterisk/asterisk/blob/14367caaf7241df1eceea7c45c5b261989c2c6db/main/manager.c#L6426","tags":["x_refsource_MISC"]},{"url":"https://github.com/asterisk/asterisk/blob/7d28165cb1b2d02d66e8693bd3fe23ee72fc55d8/main/manager.c#L6426","tags":["x_refsource_MISC"]},{"url":"https://lists.debian.org/debian-lts-announce/2024/10/msg00016.html","tags":[]}],"priority":{"score":28.6,"factors":[{"name":"EPSS percentile","points":18.4},{"name":"Public exploit code","points":5.0},{"name":"CVSS severity","points":5.18}]},"exploitSources":{"pocGithub":{"count":1,"skipped":0,"earliest":"2026-08-30","earliestUrl":"https://github.com/Raajgupta01/htb-machine-ringdown","repos":[{"name":"Raajgupta01/htb-machine-ringdown","url":"https://github.com/Raajgupta01/htb-machine-ringdown","stars":0,"created":"2026-08-30"}]},"metasploit":[{"name":"Asterisk AMI Originate Authenticated RCE","module":"exploit/linux/misc/asterisk_ami_originate_auth_rce","type":"exploit","disclosureDate":"2024-08-08","url":"https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/linux/misc/asterisk_ami_originate_auth_rce.rb"}],"first":{"date":"2024-08-08","source":"Metasploit","url":"https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/linux/misc/asterisk_ami_originate_auth_rce.rb"},"provenance":"source"},"vendorSlug":"asterisk","affectedVersions":[{"vendor":"asterisk","product":"asterisk","versions":["< 18.24.2",">= 19.0.0, < 20.9.2",">= 21.0.0, < 21.4.2","< 18.9-cert11",">= 19.0, < 20.7-cert2"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2024-08-08T16:38:45.608389Z","from":"CISA ADP","provenance":"source"},"summary":{"text":"The Asterisk PBX and telephony toolkit allows an AMI user holding only the write=originate permission to modify any file under /etc/asterisk/, because the FILE function within the SET application can append to existing files and the user can fetch remote content and write it to disk. An attacker with an authenticated AMI session carrying that permission, reachable over the network and requiring no user interaction, can use this to escalate privileges, achieve remote code execution, or perform blind server-side request forgery to arbitrary protocols.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T06:39:50Z"},"euvd":{"id":"EUVD-2024-39574","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-asterisk-cve-2023-49294","parents":[{"from":"CVE-2023-49294","to":"CVE-2024-42365","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["main/manager.c"],"commits":["https://github.com/asterisk/asterisk/commit/424be345639d75c6cb7d0bd2da5f0f407dbd0bd5","https://github.com/asterisk/asterisk/commit/42a2f4ccfa2c7062a15063e765916b3332e34cc4","https://github.com/asterisk/asterisk/commit/7a0090325bfa9d778a39ae5f7d0a98109e4651c8"],"basis":"shared function","functions":["mansession"]}]}]}}