Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security Issues in osCommerce v4 #62

Open
cupc4k3 opened this issue Mar 6, 2024 · 0 comments
Open

Security Issues in osCommerce v4 #62

cupc4k3 opened this issue Mar 6, 2024 · 0 comments

Comments

@cupc4k3
Copy link

cupc4k3 commented Mar 6, 2024

RCE via file upload bypass

Hello team, I have identified a security vulnerability while editing the administrator's profile picture. By manipulating the file extension from 'shell.gif' to 'shell.php,' as outlined in the request below, the application erroneously processed the file with the altered extension.

Steps to Reproduce

To exploit this vulnerability, I initiated the upload process of a malicious GIF file by selecting 'edit' to upload the file. The request was intercepted using Burp Suite, as depicted in the image below. Throughout this process, I modified the file extension from 'shell.gif' to 'shell.php.' The content of this file included the following payload:

GIF89a;<?php system($_GET['cmd']); ?>

The provided payload is a straightforward yet potent PHP script intended to execute system commands based on the 'cmd' parameter in the GET request. The initial 'GIF89a;' serves as a GIF file header, deceiving the server into treating the file as a harmless image. This technique is a classic illustration of circumventing upload filters by exploiting the server's file-handling logic, thereby enabling the execution of arbitrary commands.

After completing the upload, I observed that the image appeared to load successfully, but the file extension still displayed as 'shell.gif.' However, upon clicking 'Update' and re-evaluating the request, I discovered that the 'avatar' parameter contained the file 'shell.gif.' By altering this to 'shell.php,' the upload was successfully executed, and the application accepted the file.

Upon accessing the 'shell.php' file in its directory, I achieved Remote Code Execution (RCE) successfully. For instance, executing the command 'cat /etc/passwd' demonstrated the ability to run server commands and potentially access sensitive data.

Affected Pages

POST /admin/upload
POST /admin/adminaccount/saveaccount

Images

image

image

image

image

image

image

image

Remediation

File Type Verification:
Implement robust file type verification during the upload process. Check the file header and content to ensure they match the expected file type (e.g., GIF). This helps prevent attackers from manipulating file extensions and uploading malicious content.

Use Whitelisting:
Allow only specific file extensions that are necessary for the application's functionality. Whitelisting acceptable file types can reduce the risk of uploading malicious files.

File Content Inspection:
Conduct thorough inspection of the file's content, especially if it claims to be of a certain type. Analyze the structure of the file and verify that it adheres to the expected format for the specified file type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant