mirror of
https://github.com/tenrok/axios.git
synced 2026-06-08 17:22:34 +03:00
fix(CSRF): fixed CSRF vulnerability CVE-2023-45857 (#6028)
Co-authored-by: DigitalBrainJS <robotshara@gmail.com>
This commit is contained in:
+2
-2
@@ -188,8 +188,8 @@ export default isXHRAdapterSupported && function (config) {
|
||||
// Specifically not if we're in a web worker, or react-native.
|
||||
if (platform.isStandardBrowserEnv) {
|
||||
// Add xsrf header
|
||||
const xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath))
|
||||
&& config.xsrfCookieName && cookies.read(config.xsrfCookieName);
|
||||
// regarding CVE-2023-45857 config.withCredentials condition was removed temporarily
|
||||
const xsrfValue = isURLSameOrigin(fullPath) && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
|
||||
|
||||
if (xsrfValue) {
|
||||
requestHeaders.set(config.xsrfHeaderName, xsrfValue);
|
||||
|
||||
Reference in New Issue
Block a user