By running npm audit
, we identified 11 vulnerabilities, with 3 being of moderate severity and 8 being of high severity. Each vulnerability, its severity, and the packages affected have been listed below.
- Severity: High
- Affected Versions: <=2.6.8
- Description: The
debug
package is affected by inefficient regular expression complexity vulnerability and Regular Expression Denial of Service (ReDoS). - Affected Dependencies:
express
,finalhandler
,send
,serve-static
- Severity: High
- Affected Versions: <0.5.2
- Description: The
fresh
package is affected by Regular Expression Denial of Service (ReDoS).
- Severity: Moderate
- Affected Versions: <1.4.1
- Description: The
mime
package is affected by Regular Expression Denial of Service (ReDoS) when MIME lookup is performed on untrusted user input.
- Severity: Moderate
- Affected Versions: <2.0.0
- Description: The
ms
package, developed by Vercel, is affected by inefficient regular expression complexity vulnerability.
- Severity: High
- Affected Versions: <2.6.7
- Description: The
node-fetch
package forwards secure headers to untrusted sites.
- Severity: High
- Affected Versions: <=6.2.3
- Description: The
qs
package is vulnerable to Prototype Pollution Protection Bypass and Prototype Pollution.
- Severity: Moderate
- Affected Versions: 6.0.0 - 6.3.0 || 7.0.0 - 7.5.1
- Description: The
semver
package is vulnerable to Regular Expression Denial of Service (ReDoS).
All issues were resolved by running npm audit fix
, as suggested in the ouput of the intial audit. Upon running npm audit
again, no further security vulnerabilities were detected among the installed packages.
To get the app to work, we used the steps outlined below.
First we obtained an API key from Trafikverket by visitng their website, registering an account, and following the instructions there.
Next we created a .env
file in the backend
directory and added our newly acquired API key using the following format:
TRAFIKVERKET_API_KEY=<api-key-here>
We then moved to the backend
folder of the project and exectued the provided script to recreate the database and perform migrations:
bash db/reset_db.bash
We installed nodemon
as a devDependency in the project and created an npm script to use it. We then started the Express server by running:
npm run dev
Finally, in order to serve the app, we started a python HTTP server on port 9000 by navigating to the frontend
directory and running:
python3 -m http.server 9000
Christopher was not able to start the application with Express running on port 1337. After problemsolving and trying out various solutions, we decided to change the port to 1338. The application then worked fine for both of us.
We decided to go with the Vue
framework. Our reasoning for choosing this framwork was that it seemed to be somewhat of a happy medium between the complexity of Angular and React's focus on UI. At the same time, it's more popular than Svelte and has a larger user base.