Submit #1081315: outroll Vesta Control Panel 1.0.0-10 CWE-22 Path Traversalinfo

Titleoutroll Vesta Control Panel 1.0.0-10 CWE-22 Path Traversal
Description1. SUMMARY A vulnerability has been found in outroll Vesta Control Panel (vesta), in the SSL certificate handler of web/api/v1/edit/web/index.php reachable via POST /api/v1/edit/web/. The v_domain parameter is copied into a shell variable through escapeshellarg() at line 109, which protects only the shell backend, while the raw $_POST['v_domain'] value is concatenated directly into temporary certificate file paths passed to fopen() and unlink(). Without containment checks, a value such as ../../pwn_outside_sandbox escapes the mktemp -d directory and leads to path traversal (CWE-22). An authenticated panel user with a valid CSRF token can write attacker-controlled content outside the intended directory and delete or overwrite pre-existing files ending in .crt, .key or .ca. The sink pattern repeats in the SSL-removal branch. The issue was confirmed by executing the unmodified target file in a local, isolated PHP harness. 2. AFFECTED Vendor: outroll (https://github.com/outroll) Product: Vesta Control Panel / vesta (PHP frontend, shell backend) Repository: https://github.com/outroll/vesta Tested revision: master, commit 5f4ee2efe45a31d8a4c1284903923965544ddb8c (2026-07-31). Current status: master has advanced to 765509ca (2026-10-22). Comparing index.php between the two revisions shows only unrelated compatibility edits; all vulnerable fopen()/unlink() lines are unchanged and no basename(), realpath() or domain validation was added. Current master is also affected; no fixed release or patched build exists. Affected endpoint: POST /api/v1/edit/web/, parameters v_domain, v_ssl_crt, v_ssl_key, v_ssl_ca. Vulnerability class: CWE-22 Path Traversal CVSS 3.1 (original advisory): AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H, 8.8 High; see section 7. 3. ROOT CAUSE All references are to web/api/v1/edit/web/index.php. Line 109: $v_domain = escapeshellarg($_POST['v_domain']) - shell-only sanitization; the raw POST value keeps being used below. Lines 111-115: panel session and CSRF token checks, genuinely enforced. Lines 287-289: SSL save branch ($v_ssl == 'yes') runs exec('mktemp -d') into $tmpdir. Lines 294-296, 302, 310: fopen($tmpdir."/".$_POST['v_domain'].".crt", 'w') and the equivalent .key/.ca slots, followed by fwrite() of the corresponding POST fields. Raw path, no sanitization. Lines 337-339: unlink() cleanup on the same raw path with the same suffixes. Lines 405, 412, 419, 445-447: the SSL-removal branch repeats the identical fopen()/unlink() pattern. The original advisory calls this branch lines 400-419; its unlink() calls are at 445-447. Vulnerable code (save branch, lines 289, 294-296, 337): $tmpdir = $mktemp_output[0]; // from exec('mktemp -d') $fp = fopen($tmpdir."/".$_POST['v_domain'].".crt", 'w'); fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_crt'])); if (!empty($_POST['v_ssl_crt'])) unlink($tmpdir."/".$_POST['v_domain'].".crt"); The resulting JSON shows the quoted, shell-safe domain at line 109 while filesystem operations still use the unquoted POST value, so traversal reaches fopen()/unlink() without disturbing the shell backend. 4. PREREQUISITES - An authenticated panel session (administrator, or a regular user allowed to edit a web domain) and a valid CSRF token. The checks at lines 111-115 are real; unauthenticated or tokenless requests are redirected to /login/. - SSL enabled on the edited domain ($v_ssl == 'yes') for the certificate save branch. - Target paths must end in .crt, .key or .ca (fixed slot suffixes) and be writable by the panel user. - PHP 7.4 line; on PHP 8.4 the legacy file fatals before reaching the affected branch. 5. REPRODUCTION Transient arbitrary write, captured mid-request between fwrite at line 295 and unlink at line 337: POST /api/v1/edit/web/ HTTP/1.1 Host: target Cookie: PHPSESSID=<panel session> Content-Type: application/x-www-form-urlencoded token=<valid csrf token>&domain=testdomain.tld&v_domain=../../pwn_outside_sandbox&v_ssl=save&v_ssl_crt=VESTIM-B-POC-ARBITRARY-WRITE-MARKER <?php echo md5("poc"); ?>&v_ssl_key=&v_ssl_ca= The resulting path is <tmpdir>/../../pwn_outside_sandbox.crt, outside the temporary directory and the sandbox root. Because cleanup unlink() uses the same path, the file normally disappears again within the same request and persists only if that unlink fails or races. A runnable script poc/exploit.sh is attached. Persistent arbitrary delete of a pre-existing file (same headers and cookie as above): POST /api/v1/edit/web/ HTTP/1.1 token=<valid csrf token>&domain=testdomain.tld&v_domain=../victimdir/vestim_decoy&v_ssl=save&v_ssl_crt=&v_ssl_key=&v_ssl_ca=VESTIM-C-POC-DELETE-MARKER The .ca slot first overwrites the pre-planted decoy victimdir/vestim_decoy.ca with the marker, then unlink() at line 339 removes it. The deletion is persistent; the overwritten content exists only until that unlink completes. 6. CONFIRMED TECHNIQUES Validation executed the unmodified target file (commit 5f4ee2e; CRLF-form sha256 f4b465943a91d29947b4e700d5540e9b06d15d5a1446007e001285e4ac7a0737) under PHP 7.4.33 in a local Windows harness. Only shell commands, mktemp and a snapshot helper were stubbed; the PHP file was included verbatim with the same session and CSRF checks. This is a code-level harness, not a live production panel. - RUN A (benign control, v_domain=testdomain.tld): files created only inside the mktemp directory and fully cleaned up; no marker outside it, ruling out a false positive. - RUN B (v_domain=../../pwn_outside_sandbox): the marker landed at <tmpdir>/../../pwn_outside_sandbox.crt outside the sandbox root, captured mid-request; after the request it is gone due to the same-path unlink. The artifact contains exactly the harmless marker and a short PHP expression. - RUN C (v_domain=../victimdir/vestim_decoy): the pre-planted decoy vestim_decoy.ca (sha1 4016a313b0ba5c4583b546163972f0c17165e9ee) was overwritten with the attacker marker and then removed; the file is absent afterwards, confirming persistent arbitrary delete at an attacker-chosen path. - All payloads were harmless markers. No credentials or real user data were read. Raw transcripts and both artifacts are attached. 7. IMPACT AND CVSS A low-privileged panel user, or anyone holding a valid panel session, can delete arbitrary .crt/.key/.ca files within the panel user's write permissions - a reliable, persistent integrity and availability attack, for example removing certificate or key files a hosted domain depends on. The same primitive transiently writes attacker-controlled content to arbitrary paths and overwrites matching files before they are deleted. A web-root drop that wins the race against cleanup could yield code execution, but that is conditional and was not demonstrated. Confidentiality is not directly affected. The original advisory scores this as CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H (8.8). Since only write and delete were demonstrated, AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H (8.1) is a more conservative and defensible vector. Final scoring is left to the moderation team. 8. REMEDIATION - Validate v_domain against a strict domain allowlist (letters, digits, dots, hyphens) before any filesystem use. - Use basename() for the temporary certificate file names so traversal segments cannot reach fopen()/unlink(). - Resolve realpath($tmpdir.'/'.$name) and verify the prefix stays inside the mktemp directory before fopen()/unlink(). - Apply the same fix to the SSL-removal branch (fopen at 405, 412, 419; unlink at 445-447). 9. REFERENCES Project: https://github.com/outroll/vesta Tested commit: https://github.com/outroll/vesta/commit/5f4ee2efe45a31d8a4c1284903923965544ddb8c Third-party advisory with PoC was published on 2026-09-29; this submission does not rely on any external advisory link. PoC and transcripts are attached. CVE: none assigned at time of submission; requested via VulDB as CNA. 10. VALIDATION ENVIRONMENT AND DISCLOSURE NOTES Testing used a local, isolated environment (127.0.0.1) against an unmodified checkout of the affected commit; the environment was destroyed afterwards. The harness ran on Windows with stubbed VESTA_CMD binaries and PHP 7.4.33; transcripts are dated 2026-09-28. A third-party advisory including the PoC was publicly released on 2026-09-29, so the details cannot be treated as undisclosed and no first-discovery claim is made; the submitter did not author that advisory. Upstream has private channels (SECURITY.md: [email protected]; GitHub private vulnerability reporting enabled), but the submitter has not sent a separate vendor notification. The submitter's contribution is independent code-level verification, confirmation that current master is still affected, and this submission. Please merge with an existing entry if already recorded. VulDB acts as CNA; the PoC script, snapshot and transcripts are available on request.
User
 stephen30 (UID 100432)
Submission11/08/2026 13:52 (25 days ago)
Moderation12/03/2026 09:08 (25 days later)
StatusAccepted
VulDB entry448584 [outroll Vesta Control Panel up to 10.0.0-10 Web API index.php v_domain path traversal]
Points17

Might our Artificial Intelligence support you?

Check our Alexa App!