FixVibe
Research notecritical

Remote Code Execution in Sourcecodester Doctor's Appointment System 1.0 (CVE-2022-28568)

Sourcecodester Doctor's Appointment System 1.0 contains a critical vulnerability (CVE-2022-28568) that allows authenticated administrators to upload malicious files via the image upload feature, leading to Remote Code Execution (RCE).

CVE-2022-28568CWE-434

Attacker Impact

An attacker with administrative access can achieve full Remote Code Execution (RCE) on the server hosting the Doctor's Appointment System [S1]. This allows for complete data exfiltration, system manipulation, and lateral movement within the network. The vulnerability is particularly dangerous because an attacker can obtain command execution simply by knowing the path where the uploaded images are stored [S1].

Root Cause

The vulnerability stems from a failure to properly validate file types during the image upload process in the administrator panel [S1]. The system allows the upload of arbitrary files, including PHP scripts, which are then stored in a predictable directory accessible via the web [S1]. This is a classic Unrestricted Upload of File with Dangerous Type (CWE-434) [S1].

Concrete Fixes

  • File Type Whitelisting: Restrict uploads to a strict list of allowed image extensions (e.g., .jpg, .png, .gif).
  • MIME Type Validation: Verify the actual content of the file matches the declared extension using server-side libraries.
  • Filename Randomization: Rename uploaded files to random strings to prevent direct execution of known filenames.
  • Disable Execution: Configure the upload directory to prevent the execution of scripts (e.g., using .htaccess or server configuration to disable PHP execution in that folder).

How FixVibe could detect it

FixVibe could detect this vulnerability through a combination of passive and active scanning:

  • Passive Discovery: Identifying the Sourcecodester Doctor's Appointment System 1.0 by fingerprinting unique strings in the login page or administrative interface.
  • Active Gated Probes: If administrative credentials are provided, FixVibe could attempt to access the image upload endpoint and verify if it accepts non-image file extensions or lacks proper security headers on the storage directory.
Remote Code Execution in Sourcecodester Doctor's Appointment System 1.0 (CVE-2022-28568) β€” FixVibe research Β· FixVibe