Vulnerabilities in pkg:npm/st
PACKAGECVE-2017-16224 is a MODERATE (CVSS 6.1) open redirect vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting St libraries in the npm ecosystem. The issue involves open redirect in st. Remediation is available by upgrading affected packages to version 1.2.2.
pkg:npm/st
Vulnerability advisories affecting package pkg:npm/st. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-72fg-jqhx-c68p | CVE-2017-16224 | MODERATE | Open Redirect in st |
| GHSA-69rr-wvh9-6c4q | CVE-2014-3744 | HIGH | Directory Traversal in st |
CVE-2017-16224 at a Glance
Security Impact
CVSS: 6.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).
How to Fix CVE-2017-16224
To remediate this vulnerability, upgrade all affected St dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install st@1.2.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls st
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2017-16224, inspect your project dependencies using npm:
npm ls st
Analyze the terminal output to locate any version of St in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.2.2), your application is affected.
Note: The npm ls st command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect'), where the web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. In St, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2017-16224 Affected St Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
st
|
npm |
< 1.2.2
|
1.2.2
|
References
Frequently Asked Questions
What is CVE-2017-16224?
Which St versions are affected?
What version fixes CVE-2017-16224?
Is st affected?
What is the CVSS score of CVE-2017-16224?
What CWE is associated with CVE-2017-16224?
How can I check npm dependencies for CVE-2017-16224?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-72fg-jqhx-c68p",
"modified" : "2023-09-11T18:37:42Z",
"published" : "2018-08-06T21:33:31Z",
"aliases" : [ "CVE-2017-16224" ],
"summary" : "Open Redirect in st",
"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('st') \nvar http = require('http') \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> GET //cve.mitre.com/%2e%2e HTTP/1.1\n> Host: localhost:1337\n> User-Agent: curl/7.54.0\n> Accept: */*\n>\n< HTTP/1.1 301 Moved Permanently\n< cache-control: public, max-age=600\n< last-modified: Fri, 13 Oct 2017 22:56:33 GMT\n< etag: \"16777220-46488904-1507935393000\"\n< location: //cve.mitre.com/%2e%2e/\n< Date: Fri, 13 Oct 2017 22:56:41 GMT\n< Connection: keep-alive\n< Content-Length: 30\n<\n* Connection #0 to host localhost left intact\n```\n\n\n## Recommendation\n\nUpdate to version 1.2.2 or later.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "st"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.2.2"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.2.1"
}
} ],
"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"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-601" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2020-06-16T21:20:52Z",
"nvd_published_at" : null
}
}