CVE-2015-10043 (published 2023-01-14T21:15Z)

A vulnerability, which was classified as critical, was found in abreen Apollo. This affects an unknown part. The manipulation of the argument file leads to path traversal. The patch is named 6206406630780bbd074aff34f4683fb764faba71. It is recommended to apply a patch to fix this issue. The associated identifier of this vulnerability is VDB-218307.

CVSS v3 base score: 8.8, HIGH (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H)

Weakness information:
cwe_id: CWE-22
cwe_name: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
description: The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
extended_description: 
            Many file operations are intended to take place within a restricted directory. By using special elements such as ".." and "/" separators, attackers can escape outside of the restricted location to access files or directories that are elsewhere on the system. One of the most common special elements is the "../" sequence, which in most modern operating systems is interpreted as the parent directory of the current location. This is referred to as relative path traversal. Path traversal also covers the use of absolute pathnames such as "/usr/local/bin" to access unexpected files. This is referred to as absolute path traversal.
         
         

Fix information:
repo_url: https://github.com/abreen/Apollo
commit_details: repo_url: https://github.com/abreen/Apollo
author: Alexander Breen
author_date: 2015-01-29 21:26:42-05:00
msg: Patched potential file path exploit

Fixed an exploit that could have allowed users to specify file
paths elsewhere on the file system to view or delete.
repository: repo_url: https://github.com/abreen/Apollo
repo_name: abreen/Apollo
description: Homework submission & grade system in PHP
repo_language: PHP
owner: abreen
file_changes: filename: delete.php
change_type: ModificationType.MODIFY
diff: @@ -20,6 +20,10 @@ check_assignment($_GET['num'], $_GET['type']);
 $num = $_GET['num'];
 $type = $_GET['type'];
 
+// protects against attacks where '..' could be used in file path
+if (basename($_GET['file']) !== $_GET['file'])
+    trigger_error('invalid file path');
+
 delete_file($num, $type, $_SESSION['username'], $_GET['file']);
 
 $vars = array();

programming_language: PHP
filename: download.php
change_type: ModificationType.MODIFY
diff: @@ -21,6 +21,10 @@ $num = $_GET['num'];
 $type = $_GET['type'];
 $assignment_name = htmlspecialchars(assignment_name($num, $type));
 
+// protects against attacks where '..' could be used in file path
+if (basename($_GET['file']) !== $_GET['file'])
+    trigger_error('invalid file path');
+
 $path = submission_path($num, $type, $_SESSION['username'], $_GET['file']);
 
 if (!file_exists($path))

programming_language: PHP
filename: view_file.php
change_type: ModificationType.MODIFY
diff: @@ -21,6 +21,10 @@ $num = $_GET['num'];
 $type = $_GET['type'];
 $assignment_name = htmlspecialchars(assignment_name($num, $type));
 
+// protects against attacks where '..' could be used in file path
+if (basename($_GET['file']) !== $_GET['file'])
+    trigger_error('invalid file path');
+
 $path = submission_path($num, $type, $_SESSION['username'], $_GET['file']);
 
 if (!file_exists($path))

programming_language: PHP