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(deps): upgrade axios and typescript #288

Merged
merged 4 commits into from Mar 8, 2023

Conversation

jeremyadavis
Copy link
Contributor

This fixes vulnerabilities in the axios library: CVE-2022-0155 and CVE-2022-0536.

There are a couple of things to consider if this PR is worth merging:

  • There are a few breaking changes in axios along the way from 0.21.4 to 0.26.1
  • Axios used the AbortController type from the DOM library and now doesn't. The upgrade broke a type and the fix was to add "dom" to the tsconfig. Really not sure if that is the correct work around or not.
  • The upgrade needed the Omit utility type which wasn't added until 3.5.1, so I had to upgrade the typescript dependency
    TBH, I don't understand why the tsconfig doesn't exclude node_modules, so maybe that's the better approach unless I'm missing something.

I tested this locally with my company's iOS and Android app and saw no issues. I did not test on the web.

Fixes: #287

@jeremyadavis
Copy link
Contributor Author

I uncovered an issue with this upgrade and multi-part/form-data:

There is a hack to get around it, but the official fix isn't merged yet so I'm going to undo my usage of the axios upgrade until an official fix is available.

I'll try to remember to update the PR when fixed.

@chakrihacker
Copy link
Collaborator

Thanks @jeremyadavis for the PR

@noah-eigenfeld
Copy link

@jeremyadavis you should try bumping the version of axios to 0.27.2 per this comment in one of the issues you mentioned.

axios 0.27.0 refactored their error handling which broke a few tests
@jeremyadavis
Copy link
Contributor Author

I upgrade axios to 0.27.2
I confirmed that it does fix the issue with the multipart/form-data was broken using my company's React Native app.

Notably, axios 0.27.0 had refactored their error handling which broke a couple of tests that had expected null responses, that now have explicit error strings.

@tgensol
Copy link

tgensol commented Jun 27, 2022

Any update on this one ? thank you !

@florinvasilevilsan
Copy link

Could someone please merge and release this? It has been months since it was opened.

@hariks-mm
Copy link

@infinitered-circleci @jamonholmgren
Any update on this?

Thank you

@TheWirv
Copy link
Contributor

TheWirv commented Oct 13, 2022

What's the status on this?

@eithe eithe mentioned this pull request Nov 28, 2022
@eithe
Copy link
Contributor

eithe commented Nov 28, 2022

Any chance this could be merged and released? Perhaps labeled as beta for a while?

@nazrdogan
Copy link

Any update ?

@pgodha
Copy link

pgodha commented Jan 11, 2023

When this PR can be merged? upgrading axios lib version will fix CVE-2022-0155 and CVE-2022-0536.

@surethink
Copy link

@infinitered-circleci any one can merge this? thanks

@eithe
Copy link
Contributor

eithe commented Feb 21, 2023

Pretty please @jamonholmgren, is anyone on your team able to merge this? Or should we move on from apisauce? That's ok, but would be good to know.

@jamonholmgren
Copy link
Member

Hey folks, I'll take a look at this. Kinda slipped off my radar. Not enough people tagged me 😂

@jamonholmgren jamonholmgren merged commit a1ae536 into infinitered:master Mar 8, 2023
infinitered-circleci pushed a commit that referenced this pull request Mar 8, 2023
# [3.0.0](v2.1.6...v3.0.0) (2023-03-08)

### Bug Fixes

* **.circleci:** Add infinitered-npm-package context ([abfba3a](abfba3a))
* **circleci:** Set context in proper place ([#306](#306)) ([6702d84](6702d84))

### Features

* **deps:** upgrade axios and typescript ([#288](#288) by [@jeremyadavis](https://github.com/jeremyadavis)) ([a1ae536](a1ae536))

### BREAKING CHANGES

* **deps:** upgrades axios to latest version [with some breaking changes](https://github.com/axios/axios/blob/main/CHANGELOG.md) (shouldn't have an effect on most projects but we are releasing as a breaking change to be safe)
@infinitered-circleci
Copy link

🎉 This PR is included in version 3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@jamonholmgren
Copy link
Member

@jeremyadavis Thanks a ton for sending in this PR, and for your patience.

We've been focusing on Ignite and Reactotron lately, but apisauce is on our list to revive at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update axios dependency to pick up vulnerability