http_server@1.0.12 vulnerabilities

这是一个静态的http服务器

Direct Vulnerabilities

Known vulnerabilities in the http_server package. This does not include vulnerabilities belonging to this package’s dependencies.

Automatically find and fix vulnerabilities affecting your projects. Snyk scans for vulnerabilities and provides fixes for free.
Fix for free
Vulnerability Vulnerable Version
  • H
Arbitrary File Read

http_server is a http server module

Affected versions of this package are vulnerable to Arbitrary File Read. It is a path traversal attack (also known as directory traversal) that 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 http_server
  • Run 'http_server in ~/Desktop directory :
root@kali:~/Desktop# http_server
server running is :http://localhost:8888
  • Use cURL to access etc/passwd file: $ curl --path-as-is --url 'http://localhost:8888/../../../../../etc/passwd'

How to fix Arbitrary File Read?

There is no fixed version for http_server.

*
  • M
Directory Traversal

http_server is a http server module

Affected versions of this package are vulnerable to Directory Traversal. With a symbolically linked file is present witin the working directory, it is possible to read arbitrary files outside of the web root directory.

PoC by vineetpandey

1. Install the http_server: npm install http_server -g

2. Create a symlink file within the directory
ln -s /etc/shadow test_shadow

3. Request the file within browser
http://localhost:8888/test_shadow

How to fix Directory Traversal?

There is no fixed version for http_server.

*
  • L
Cross-site Scripting (XSS)

http_server is a http server module

Affected versions of this package are vulnerable to Cross-site Scripting (XSS). This vulnerability occurs due to the module representing filename(s) in HTML without any sanitization when listing the directory page. As a result, any malicious scripts which are injected and stored on the server, will be executed in the client's browser.

How to fix Cross-site Scripting (XSS)?

There is no fixed version for http_server.

*