Skip to content

Untrusted Deserialization in ClipBucket-v5 Version 2.0 to 5.5.1 Revision 199

High
MacWarrior published GHSA-4523-mqmv-wrqx Dec 6, 2024

Package

No package listed

Affected versions

2.0 =< 5.5.1 - 199

Patched versions

>= 5.5.1 - 200

Description

Summary

An unsafe deserialization vulnerability allows an authenticated user to cause unexpected behaviours of the application. This includes arbitrary file deletion which affects application availabilities. Possibly it can lead to arbitrary command execution if an adversary can chain gadgets within the application.
Also, if the application allows self registration (enabled by default) an unauthenticated user can exploit this issue by creating a new user account.

Details

ClipBucket-v5 Version 2.0 to Version 5.5.1 Revision 199 are vulnerable to PHP Deserialization vulnerability. The vulnerability exists in upload/photo_upload.php line 11 and line 23 specifically within the decode_key function. User inputs were supplied to this function without sanitisation via collection GET parameter (line 10) and photoIDS POST parameter respectively. The decode_key function invokes PHP unserialize function as defined in upload/includes/classes/photos.class.php at line 2888. As a result, it is possible for an adversary to inject maliciously crafted PHP serialised object and utilise gadget chains to cause unexpected behaviours of the application.

PoC

An adversary can register itself via Sign up feature of the application.
With the valid user session, malicious payloads can be supplied via https://[URL]/photo_upload.php endpoint and its collection GET parameter or photoIDS POST parameter.
As a proof of concept, known gadget chains from PHPGGC can be used to delete arbitrary files.
A sample payload can be generated as shown below:
image.
The payload needs to be base64 encoded to be supplied to the collection GET parameter or photoIDS POST parameter, and the final HTTP request is shown below:

  • GET Request
    image.
  • POST Request
    image.
    Note that with the POST Request requires an EnterInfo parameter within the body along with the photoIDS parameter

These payloads end up deleting /tmp/toDelete.txt in this case, however the file can be anythings and will be removed as long as the file permissions allowed.
See below for the application trying to delete this file:
image.

Impact

If an adversary successfully exploited this issue, it was possible to delete arbitrary files within the file system. An adversary could delete any of the application source files to make the application unusable, or if the application relies on a specific file to restrict access to installer an adversary could initiate application installation and create a new administrative user account. This essentially takes over the application.
Also, if an adversary can identify another gadget chain it would be possible to obtain remote code execution.

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

CVE ID

CVE-2024-54135

Weaknesses

Credits