Ecosyste.ms: Advisories
An open API service providing security vulnerability metadata for many open source software ecosystems.
Security Advisories: MDE2OlNlY3VyaXR5QWR2aXNvcnlHSFNBLXFtdjQtamdwNy1tZjY4
Sails before 0.12.7 vulnerable to Broken CORS
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.
Mitigating Factors
This 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.
The problem can be compounded when the cors credentials
setting is not provided, because at that point authenticated cross domain requests are possible.
Recommendation
Update to version 0.12.7 or later.
As 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.
Writing 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.
Likewise, ensure credentials
is uncommented out and set to the appropriate value. Make sure to explicitly set which origins may request resources via CORS.
JSON: https://advisories.ecosyste.ms/api/v1/advisories/MDE2OlNlY3VyaXR5QWR2aXNvcnlHSFNBLXFtdjQtamdwNy1tZjY4
Source: GitHub Advisory Database
Origin: Unspecified
Severity: High
Classification: General
Published: almost 6 years ago
Updated: almost 2 years ago
Identifiers: GHSA-qmv4-jgp7-mf68, CVE-2016-10549
References:
- https://nvd.nist.gov/vuln/detail/CVE-2016-10549
- https://www.npmjs.com/advisories/148
- http://sailsjs.org/documentation/concepts/security/cors
- http://sailsjs.org/documentation/reference/configuration/sails-config-cors
- https://github.com/balderdashy/sails/commit/0057123a0321be6758845abbeb4290bf418ce542
- https://github.com/balderdashy/sails/releases/tag/v0.12.7
- https://github.com/advisories/GHSA-qmv4-jgp7-mf68
Blast Radius: 0.0
Affected Packages
npm:sails
Dependent packages: 540Dependent repositories: 7,207
Downloads: 116,728 last month
Affected Version Ranges: < 0.12.7
Fixed in: 0.12.7
All affected versions: 0.0.0, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.7.4, 0.7.7, 0.7.8, 0.7.9, 0.8.0, 0.8.1, 0.8.2, 0.8.3, 0.8.4, 0.8.5, 0.8.6, 0.8.7, 0.8.9, 0.8.71, 0.8.72, 0.8.73, 0.8.74, 0.8.75, 0.8.76, 0.8.77, 0.8.78, 0.8.79, 0.8.80, 0.8.81, 0.8.82, 0.8.83, 0.8.84, 0.8.85, 0.8.86, 0.8.87, 0.8.88, 0.8.89, 0.8.91, 0.8.92, 0.8.93, 0.8.94, 0.8.892, 0.8.894, 0.8.895, 0.9.0, 0.9.1, 0.9.2, 0.9.3, 0.9.4, 0.9.5, 0.9.7, 0.9.8, 0.9.9, 0.9.11, 0.9.12, 0.9.13, 0.9.15, 0.9.16, 0.9.17, 0.10.1, 0.10.2, 0.10.3, 0.10.4, 0.10.5, 0.11.0, 0.11.1, 0.11.2, 0.11.3, 0.11.4, 0.11.5, 0.12.0, 0.12.1, 0.12.2, 0.12.3, 0.12.4, 0.12.5, 0.12.6
All unaffected versions: 0.12.7, 0.12.8, 0.12.9, 0.12.10, 0.12.11, 0.12.12, 0.12.13, 0.12.14, 1.0.0, 1.0.1, 1.0.2, 1.1.0, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 1.3.0, 1.3.1, 1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.5.5, 1.5.6, 1.5.7, 1.5.8, 1.5.9, 1.5.10, 1.5.11, 1.5.12, 1.5.13