Steps to reproduce
- Use the
platform@0.0.1 package with loopback-connector-mssql@3.8.0, which in turn uses mssql@6.4.1.
- This package relies on
axios@0.21.4, which is affected by a CSRF vulnerability.
- Enable
withCredentials setting, and if the X-XSRF-TOKEN header is inserted using the secret XSRF-TOKEN cookie value, CSRF vulnerability is triggered.
Current Behavior
The vulnerability is introduced through the dependency chain:
platform@0.0.1 > loopback-connector-mssql@3.8.0 > mssql@6.4.1 > tedious@6.7.1 > @azure/ms-rest-nodeauth@3.1.1 > adal-node@0.2.4 > axios@0.21.4.
When the XSRF-TOKEN cookie is available and withCredentials is enabled, the X-XSRF-TOKEN header is automatically sent in requests to the server. This can potentially bypass CSRF protections if an attacker manages to obtain this token.
Expected Behavior
- The package
mssql should be updated to 11.0.1 or a version that resolves the CSRF vulnerability.
- There should be an update to
axios to address the CSRF issue by improving the handling of X-XSRF-TOKEN and XSRF-TOKEN cookies.
Link to reproduction sandbox
N/A
Additional information
node -e 'console.log(process.platform, process.arch, process.versions.node)'
Output: <platform info>
npm ls --prod --depth 0 | grep loopback
Output: <dependency tree info>
Related Issues
No related issues found.
Note: The issue is related to the CSRF vulnerability in axios@0.21.4. The fix would require an update to the mssql dependency to resolve the security issue introduced by axios.

Steps to reproduce
platform@0.0.1package withloopback-connector-mssql@3.8.0, which in turn usesmssql@6.4.1.axios@0.21.4, which is affected by a CSRF vulnerability.withCredentialssetting, and if theX-XSRF-TOKENheader is inserted using the secretXSRF-TOKENcookie value, CSRF vulnerability is triggered.Current Behavior
The vulnerability is introduced through the dependency chain:
platform@0.0.1 > loopback-connector-mssql@3.8.0 > mssql@6.4.1 > tedious@6.7.1 > @azure/ms-rest-nodeauth@3.1.1 > adal-node@0.2.4 > axios@0.21.4.When the
XSRF-TOKENcookie is available andwithCredentialsis enabled, the X-XSRF-TOKEN header is automatically sent in requests to the server. This can potentially bypass CSRF protections if an attacker manages to obtain this token.Expected Behavior
mssqlshould be updated to11.0.1or a version that resolves the CSRF vulnerability.axiosto address the CSRF issue by improving the handling ofX-XSRF-TOKENandXSRF-TOKENcookies.Link to reproduction sandbox
N/A
Additional information
node -e 'console.log(process.platform, process.arch, process.versions.node)'Output:
<platform info>npm ls --prod --depth 0 | grep loopbackOutput:
<dependency tree info>Related Issues
No related issues found.
Note: The issue is related to the CSRF vulnerability in
axios@0.21.4. The fix would require an update to themssqldependency to resolve the security issue introduced byaxios.