Skip to content
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

Merged
merged 4 commits into from
Dec 4, 2023

Conversation

Shyann
Copy link
Contributor

@Shyann Shyann commented Oct 28, 2023

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

  • Changes to the following files to upgrade the vulnerable dependencies to a fixed version:
    • package.json
    • package-lock.json

Vulnerabilities that will be fixed

With an upgrade:
Severity Priority Score (*) Issue Breaking Change Exploit Maturity
high severity 748/1000
Why? Proof of Concept exploit, Recently disclosed, Has a fix available, CVSS 7.1
Cross-site Request Forgery (CSRF)
SNYK-JS-AXIOS-6032459
Yes Proof of Concept

(*) 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.
  • f7adacd chore(release): v1.6.0 (#6031)
  • 9917e67 chore(ci): fix release-it arg; (#6032)
  • 96ee232 fix(CSRF): fixed CSRF vulnerability CVE-2023-45857 (#6028)
  • 7d45ab2 chore(tests): fixed tests to pass in node v19 and v20 with `keep-alive` enabled; (#6021)
  • 5aaff53 fix(dns): fixed lookup function decorator to work properly in node v20; (#6011)
  • a48a63a chore(docs): added AxiosHeaders docs; (#5932)
  • a1c8ad0 fix(types): fix AxiosHeaders types; (#5931)
  • 2ac731d chore(docs): update readme.md (#5889)
  • 88fb52b chore(release): v1.5.1 (#5920)
  • e410779 fix(adapters): improved adapters loading logic to have clear error messages; (#5919)
  • bc9af51 fix(formdata): fixed automatic addition of the `Content-Type` header for FormData in non-browser environments; (#5917)
  • 4c89f25 fix(headers): allow `content-encoding` header to handle case-insensitive values (#5890) (#5892)
  • ae00391 docs(paramsSerializer config within request config): update documentation for paramsSerializer
  • a989ccd Change isNaN to Number.isNaN
  • b5b7760 docs: fix CommonJS usage note
  • 9e62056 fix(types): removed duplicated code
  • 6365751 chore(release): v1.5.0 (#5838)
  • 1601f4a feat(export): export adapters without `unsafe` prefix (#5839)
  • dff74ae docs: linting documentation notes (#5791)
  • ca73eb8 feat: export getAdapter function (#5324)
  • 9a414bb fix(adapter): make adapter loading error more clear by using platform-specific adapters explicitly (#5837)
  • b3e327d fix(dns): fixed `cacheable-lookup` integration; (#5836)
  • 8fda276 fix(headers): fixed common Content-Type header merging; (#5832)
  • d8b4ca0 fix(headers): added support for setting header names that overlap with class methods; (#5831)

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)

@Shyann Shyann requested a review from a team as a code owner October 28, 2023 02:36
snyk-bot and others added 4 commits December 1, 2023 12:30
This change ensures compatibility with Axios 1.x's AxiosRequestHeaders type
and resolves TypeScript type mismatch issues.
@cat2608 cat2608 force-pushed the snyk-fix-0df67984f09f7a05869d0c2826b55c00 branch from 3ebe03f to 9fc9cda Compare December 1, 2023 13:51
req.headers = {
...req.headers,
Authorization: `token ${token}`,
} as { [header: string]: string };

req.headers['Authorization'] = `token ${token}`;
Copy link
Contributor

@cat2608 cat2608 Dec 1, 2023

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.

Copy link
Contributor

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?

Copy link
Contributor

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
  }

image

@cat2608 cat2608 changed the title [Snyk] Security upgrade axios from 0.27.2 to 1.6.0 fix: security upgrade axios from 0.27.2 to 1.6.0 [HEAD-1036] Dec 1, 2023
@cat2608 cat2608 merged commit 7d05d3e into main Dec 4, 2023
6 checks passed
@cat2608 cat2608 deleted the snyk-fix-0df67984f09f7a05869d0c2826b55c00 branch December 4, 2023 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants