ecstatic@0.1.1 vulnerabilities

A simple static file server middleware

Direct Vulnerabilities

Known vulnerabilities in the ecstatic 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
Denial of Service (DoS)

ecstatic is a simple static file server middleware. Use it with a raw http server, express/connect or on the CLI.

Affected versions of this package are vulnerable to Denial of Service (DoS). It is possible to crash a server using the package due to the way URL params parsing is handled during redirect.

PoC

curl --path-as-is $(echo -e -n "http://127.0.0.1:8080/existing-dir-name?\x0cfoo")

In the PoC the library is trying to redirect /existing-dir-name?\x0cfoo to /existing-dir-name/?\x0cfoo which cause TypeError: The header content contains invalid characters error because of \x0c symbol.

How to fix Denial of Service (DoS)?

Upgrade ecstatic to version 4.1.4 or higher.

<4.1.4
  • M
Open Redirect

ecstatic is a simple static file server middleware. Use it with a raw http server, express/connect or on the CLI.

Affected versions of this package are vulnerable to Open Redirect. The package failed to validate redirects, allowing attackers to craft requests that result in an HTTP 301 redirect to any other domains.

How to fix Open Redirect?

Upgrade ecstatic to version 2.2.2, 3.3.2, 4.1.2 or higher.

<2.2.2 >=3.0.0 <3.3.2 >=4.0.0 <4.1.2
  • M
Denial of Service (DoS)

ecstatic is a simple static file server middleware. Use it with a raw http server, express/connect or on the CLI.

Affected versions of this package are vulnerable to Denial of Service (DoS). The process of replacing null bytes in the url string is being done in a loop:

Find Null Bytes --> If found remove Null Byte --> Repeat

When no more Null Bytes found, the flow of the program continues.

This method would work fine with a normal URL that should be relatively short, but a malicious user may craft a very long URL with a lot of Null Bytes.

PoC by Checkmarx:

http://www.checkmarx.com/advisories/%00%00%00%00%00%00...

Slowdown:

A payload of 22kB caused a lag of 1 second, A payload of 35kB caused a lag of 3 seconds, A payload of 86kB caused the server to crash

How to fix Denial of Service (DoS)?

Upgrade ecstatic to version 2.0.0 or higher.

<2.0.0
  • H
Denial of Service (DoS)

ecstatic is a simple static file server middleware. Use it with a raw http server, express/connect or on the CLI.

Affected versions of this package are vulnerable to Denial of Service (DoS). The vulnerability is caused by the combination of two bugs. First, the underlying V8 engine throws an exception when processing the specially crafted date, instead of stating the date is invalid as it should. Second, the ecstatic server does not handle the exception, triggering the crash.

Upgrading Ecstatic will address the second issue and thus fix the vulnerability.

How to fix Denial of Service (DoS)?

Upgrade ecstatic to version 1.4.0 or higher.

<1.4.0
  • H
Denial of Service (DoS)

ecstatic is a simple static file server middleware. Use it with a raw http server, express/connect or on the CLI.

Affected versions of this package are vulnerable to Denial of Service (DoS). The vulnerability is caused by the combination of two bugs. First, the underlying V8 engine throws an exception when processing the specially crafted date, instead of stating the date is invalid as it should. Second, the ecstatic server does not handle the exception, triggering the crash.

Upgrading Ecstatic will address the second issue and thus fix the vulnerability.

How to fix Denial of Service (DoS)?

Upgrade ecstatic to version 1.4.0 or higher.

<1.4.0