Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
application
folder:axios@0.19.2
toaxios@0.21.4
.react@16.14.0
toreact@17.0.2
.react-dom@16.14.0
toreact-dom@17.0.2
.react-redux@7.2.4
toreact-redux@7.2.5
.react-router-dom@5.2.0
toreact-router-dom@5.2.1
.react-scripts@3.0.1
toreact-scripts@4.0.3
.redux@4.1.0
toredux@4.1.1
.server
folder:dotenv@8.0.0
todotenv@8.6.0
.mongoose@5.7.7
tomongoose@5.13.9
.morgan@1.9.1
tomorgan@1.10.0
.nodemon@1.19.1
tonodemon@2.0.12
.Purpose
Some (if not all) of the dependencies both in the
server
andapplication
folders should be updated to prevent any security exploits along with some potential bugs.Approach
Since both folders of
application
andserver
needed to be updated along with their explanations, this Approach section would be split into sections Application and Server.Application
For the dependency
axios
, one of the biggest update for0.21.2
was a added security fix for ReDoS vulnerability. Others included a addedparseInt
toconfig.timeout
, and a fixed quadratic runtime and extra memory usage when setting amaxContentLength
. Another update for0.21.3
was a fixed response interceptor that was not being called when request interceptor is attached. Lastly, in version0.21.4
, there was a fixed on JSON transform when data is stringified, and this provides backward compatibility and complying to the JSON RFC standard. With all of these security vulnerability fix, and bug fixes, it makes sense to updateaxios@0.19.2
toaxios@0.21.4
.The
bootstrap
dependency did not needed to be updated since there were no known security vulnerability. Yet, there is a new version5.0.0
update with new features, but this could have breaking changes with the argument that there is no need to update the new version at the moment for the current orders application.For the dependencies of
react
andreact-dom
, there was an update for17.0.2
which removed an unused dependency to address theSharedArrayBuffer
cross-origin isolation warning. For this reason,react@16.14.0
andreact-dom@16.14.0
were updated toreact@17.0.2
andreact-dom@17.0.2
, respectively.For the
react-redux
dependency, the update for7.2.5
was more on subscription size which shaved a few bytes off the final bundle size, and optimization where it updated theuseSelector
to avoid an unnecessary selector call on mount. For these slight reasons, it seems good to updatereact-redux@7.2.4
toreact-redux@7.2.5
for performance.For the
react-router-dom
dependency, the update for5.2.1
was a bug fix where it fixed the<Link>
component so that, when theto
location is the same as the current, the history state entry is replaced instead of pushed to the stack. For this reason,react-router-dom@5.2.0
was updated toreact-router-dom@5.2.1
for a bug fix.For the
react-scripts
dependency, there are few reasons for updating to4.0.3
: on version update3.3.0
, it supports optional chaining and nullish coalescing operators; the current age ofreact-scripts@3.0.1
was from May 8th, 2019, and so updating it to the newer one would fix any bugs; and lastly, it needs to be in sync and compatible after updatingreact@16.14.0
andreact-dom@16.14.0
toreact@17.0.2
andreact-dom@17.0.2
. Thus, it makes sense to updatereact-scripts@3.0.1
toreact-scripts@4.0.3
.For the
redux
dependency, the reasoning is very minor, but it has to do with a bug fixed for Safari users on development mode. Might not be a big deal, but could become a bigger problem if deploying the app worldwide where it might be a bad user experience for Safari users seeing an app crash. Multiple information with the version update of4.1.1
, #4090 PR, #4089 Issue, and from Stackoverflow. For these reasonings to bring a better experience for Safari users,redux@4.1.0
was updated toredux@4.1.1
.Server
For the
dotenv
dependency: Inv8.2.0
, it added TypeScript types. Inv8.5.1
, it updated development dependencies via npm audit. Lastly, inv8.6.0
, it definedpackage.json
in exports. Combined with the potential security vulnerability fix inv8.5.1
, and with TypeScript support inv8.2.0
, it makes sense to update tov8.6.0
.For the
mongoose
dependency, inv5.13.3
, according tosynk.io
, it has a medium severity of "Prototype Pollution". The vulnerable module ismpath
which was introduced frommpath@0.8.3
. The remediation would be to upgrade tomongoose@5.13.9
. Further explanation:Since the current version of
mongoose
is at6.0.5
with some breaking changes, it makes sense to update it at5.13.9
until there is a need to update to version 6.For the dependency of
morgan
, inv1.10.0
, the dev team had updated their dependencies which mean there are potential security fixes upon these updates. Because of this, it makes sense to updatemorgan@1.9.1
tomorgan@1.10.0
.For the
nodemon
development dependency, according to snyk.io,v1.19.1
has high severities of Regular Expression Denial of Service (ReDoS) and of Prototype Pollution; and its medium severity is the same of ReDoS. Inv2.0.3
, it has been updated for bug fixes onpackage.json
andpackage-lock.json
to reduce vulnerabilities according to their commit. Yet, both versions of2.0.3
and2.0.12
have the same severity of ReDoS, and since they both have it, then it makes sense to just update it to2.0.12
. Once the developers for this package has fixed the severity, than a new update should be done.Testing
application
folder, and typenpm install
ornpm i
to install the new updated packages.server
folder, and typenpm install
ornpm i
to install the new updated packages.application
andserver
folders, use the terminal to have the Docker image updated by typing at the project root directorydocker compose up --build
.Learning
Axios:
React/React-dom:
SharedArrayBuffer
cross-origin isolation warning.React-redux:
React-router-dom:
React-scripts:
Redux:
Dotenv:
Mongoose:
Morgan:
Nodemon:
Closes #7