-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: security upgrade axios from 0.27.2 to 1.6.0 [HEAD-1036] #387
Conversation
The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-AXIOS-6032459
This change ensures compatibility with Axios 1.x's AxiosRequestHeaders type and resolves TypeScript type mismatch issues.
3ebe03f
to
9fc9cda
Compare
req.headers = { | ||
...req.headers, | ||
Authorization: `token ${token}`, | ||
} as { [header: string]: string }; | ||
|
||
req.headers['Authorization'] = `token ${token}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change needed due to Axios upgrade. This change sets the Authorization
header individually instead of overwriting the entire headers object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: if this is the only place where axios is used, we may be able to get rid of the functionality entirely. I think advisor is a remnant of an incomplete contribution, which we need to remove anyway. Have you found any location where it is used in the extension right now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bastiandoetsch after some research, I can see that this feature was completed here. I'm not sure why it's not a toggle in the settings of Snyk. To be able to see it, we enabled it with
"snyk.features.preview": {
"advisor": true
}
This PR was automatically created by Snyk using the credentials of a real user.
Snyk has created this PR to fix one or more vulnerable packages in the `npm` dependencies of this project.
Changes included in this PR
Vulnerabilities that will be fixed
With an upgrade:
Why? Proof of Concept exploit, Recently disclosed, Has a fix available, CVSS 7.1
SNYK-JS-AXIOS-6032459
(*) Note that the real score may have changed since the PR was raised.
Commit messages
Package name: axios
The new version differs by 250 commits.See the full diff
Check the changes in this PR to ensure they won't cause issues with your project.
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.
For more information:
🧐 View latest project report
🛠 Adjust project settings
📚 Read more about Snyk's upgrade and patch logic
Learn how to fix vulnerabilities with free interactive lessons:
🦉 Cross-site Request Forgery (CSRF)