CVE-2016-10549: Sails Sails Before 0.12.7 Vulnerable To Vulnerability
HIGHCVE-2016-10549 is a HIGH sails before 0.12.7 vulnerable to vulnerability (CWE-284: Improper Access Control) affecting Sails libraries in the npm ecosystem. The issue involves sails before 0.12.7 vulnerable to broken cors. Remediation is available by upgrading affected packages to version 0.12.7.
CVE-2016-10549 at a Glance
How to Fix CVE-2016-10549
To remediate this vulnerability, upgrade all affected Sails 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 sails@0.12.7
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls sails
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2016-10549, inspect your project dependencies using npm:
npm ls sails
Analyze the terminal output to locate any version of Sails in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.12.7), your application is affected.
Note: The npm ls sails 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-284: Improper Access Control, where the product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. In Sails, 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-2016-10549 Affected Sails Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
sails
|
npm |
< 0.12.7
|
0.12.7
|
References
Frequently Asked Questions
What is CVE-2016-10549?
Which Sails versions are affected?
What version fixes CVE-2016-10549?
Is sails affected?
What CWE is associated with CVE-2016-10549?
How can I check npm dependencies for CVE-2016-10549?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-qmv4-jgp7-mf68",
"modified" : "2022-08-03T21:27:52Z",
"published" : "2019-02-18T23:40:10Z",
"aliases" : [ "CVE-2016-10549" ],
"summary" : "Sails before 0.12.7 vulnerable to Broken CORS",
"details" : "Affected versions of `sails` have an issue with the CORS configuration where the value of the origin header is reflected as the value for the `Access-Control-Allow-Origin` header. This may allow an attacker to make AJAX requests to vulnerable hosts through cross-site scripting or a malicious HTML Document, effectively bypassing the Same Origin Policy. \n\n## Mitigating Factors\n\nThis is only an issue when `allRoutes` is set to `true` and `origin` is set to `*` or left commented out in the sails CORS config file. \n\nThe problem can be compounded when the cors `credentials` setting is not provided, because at that point authenticated cross domain requests are possible.\n\n\n## Recommendation\n\nUpdate to version 0.12.7 or later.\n\nAs this vulnerability is primarily a user error, the patch for the vulnerability will simply cause the application to write an error message to the console when a vulnerable configuration is used in a production environment.\n\nWriting a proper CORS configuration is still the responsibility of the user, so it is necessary to check for the error message after installing the patch. Be sure you are not using `allRoutes: true` with `origin:'*'`, and that you uncomment `origin` and set it to a reasonable value. Ensure that if `origin` is set to `*` that you truly mean for all other websites to be able to make cross-domain requests to your API.\n\nLikewise, ensure `credentials` is uncommented out and set to the appropriate value. Make sure to explicitly set which origins may request resources via CORS.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "sails"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.12.7"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2016-10549"
}, {
"type" : "WEB",
"url" : "https://github.com/balderdashy/sails/commit/0057123a0321be6758845abbeb4290bf418ce542"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/balderdashy/sails"
}, {
"type" : "WEB",
"url" : "https://github.com/balderdashy/sails/releases/tag/v0.12.7"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/advisories/148"
}, {
"type" : "WEB",
"url" : "http://sailsjs.org/documentation/concepts/security/cors"
}, {
"type" : "WEB",
"url" : "http://sailsjs.org/documentation/reference/configuration/sails-config-cors"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-284" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2020-06-16T21:52:24Z",
"nvd_published_at" : null
}
}