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

Calling /rest/order-history without the JWT crashes Juice Shop [🐛] #1628

Closed
Konachan opened this issue May 17, 2021 · 3 comments
Closed
Labels

Comments

@Konachan
Copy link

🐛 Bug report

Description

After calling /rest/order-history without the Authorization header causes Juice Shop to throw an error and exit completely.

Is this a regression?

Unknown

🔬 Minimal Reproduction

Call:


GET /rest/order-history HTTP/1.1
Host: :3000
Accept: application/json, text/plain, */*
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36
Referer: http://:3000/
Accept-Encoding: gzip, deflate
Connection: close

Note: I removed some other Headers but the one causing the error is Authorization. Tested by removing them one by one.

🔥 Exception or Error


TypeError: Cannot read property 'replace' of undefined
    at /home/kona/Schreibtisch/juice-shop_12.7.1/build/routes/orderHistory.js:12:88
    at Layer.handle [as handle_request] (/home/kona/Schreibtisch/juice-shop_12.7.1/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/kona/Schreibtisch/juice-shop_12.7.1/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/home/kona/Schreibtisch/juice-shop_12.7.1/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/home/kona/Schreibtisch/juice-shop_12.7.1/node_modules/express/lib/router/layer.js:95:5)
    at /home/kona/Schreibtisch/juice-shop_12.7.1/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/home/kona/Schreibtisch/juice-shop_12.7.1/node_modules/express/lib/router/index.js:335:12)
    at next (/home/kona/Schreibtisch/juice-shop_12.7.1/node_modules/express/lib/router/index.js:275:10)
    at /home/kona/Schreibtisch/juice-shop_12.7.1/build/routes/verify.js:133:5
    at Layer.handle [as handle_request] (/home/kona/Schreibtisch/juice-shop_12.7.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/kona/Schreibtisch/juice-shop_12.7.1/node_modules/express/lib/router/index.js:317:13)
    at /home/kona/Schreibtisch/juice-shop_12.7.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/home/kona/Schreibtisch/juice-shop_12.7.1/node_modules/express/lib/router/index.js:335:12)
    at next (/home/kona/Schreibtisch/juice-shop_12.7.1/node_modules/express/lib/router/index.js:275:10)
    at /home/kona/Schreibtisch/juice-shop_12.7.1/build/routes/verify.js:69:5
    at Layer.handle [as handle_request] (/home/kona/Schreibtisch/juice-shop_12.7.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/kona/Schreibtisch/juice-shop_12.7.1/node_modules/express/lib/router/index.js:317:13)
    at /home/kona/Schreibtisch/juice-shop_12.7.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/home/kona/Schreibtisch/juice-shop_12.7.1/node_modules/express/lib/router/index.js:335:12)
    at next (/home/kona/Schreibtisch/juice-shop_12.7.1/node_modules/express/lib/router/index.js:275:10)
    at logger (/home/kona/Schreibtisch/juice-shop_12.7.1/node_modules/morgan/index.js:144:5)
    at Layer.handle [as handle_request] (/home/kona/Schreibtisch/juice-shop_12.7.1/node_modules/express/lib/router/layer.js:95:5)

🌳 Your Environment




v15.14.0
7.9.0

Additional Information

@Konachan Konachan added the bug label May 17, 2021
@github-actions
Copy link

Thanks a lot for opening your first issue with us! 🧡 We'll get back to you shortly! ⏳ If it was a Support Request, please consider asking on the community chat next time! 💬

@bkimminich
Copy link
Member

💥 Ouch... Good catch! 👍

bkimminich added a commit that referenced this issue May 18, 2021
(fixes #1628 and similar issue in data export route)
@github-actions
Copy link

This thread has been automatically locked because it has not had recent activity after it was closed. 🔒 Please open a new issue for regressions or related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators May 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants