question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. Itย collects links to all the places you might be looking at while hunting down a tough bug.

And, if youโ€™re still stuck at the end, weโ€™re happy to hop on a call to see how we can help out.

[๐Ÿ›] A possible bug when solving the challenge "Expired Coupon"

See original GitHub issue

๐Ÿ› Bug report

Description

Hello! I`ve found a bug when solving the โ€œExpired Couponโ€ in another way.

I found a way to bypass the date validation by using breakpoint and editing the โ€œthis.clientdateโ€ in the console.

The discount worked, but the challenge didn`t solved.

Is this a regression?

IDKโ€ฆ

๐Ÿ”ฌ Minimal Reproduction

I use the Juice Shop in Simplified Chinese, but I think these pictures would contain necessary infomation.

1 2 3 4 5

๐Ÿ”ฅ Exception or Error

No.

๐ŸŒณ Your Environment

Docker

Additional Information

Windows10, Firefox85.0.2, OWASP ZAP

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
bkimminichcommented, Feb 11, 2021

Ah ok, if the coupon wasnโ€™t really accepted, then it makes sense you didnโ€™t see the confirmation. In our step by step solution we recommend to change the system time, and our end to end test https://www.github.com/bkimminich/juice-shop/tree/master/test%2Fe2e%2FbasketSpec.js overloads the new Date() call to give back the campaign date.

1reaction
TracingDronecommented, Feb 11, 2021

@TokinoLynx ่ฏท้—ฎๅฏไปฅ็กฎ่ฎคไธ€ไธ‹่ฎขๅ•ๆœ€ๅŽๅฎž้™…ไป˜ๆฌพๅŽ็œŸ็š„ๆ‰“ๆŠ˜ไบ†ๅ—?ๆˆ‘่ฏ•้ชŒๅ‘็Žฐไป…ไป…ๅœจๅ›พไธญ้‚ฃ่กŒๆ–ญ็‚นๅŽไฟฎๆ”นclientDateๅ€ผ,่™ฝ็„ถUIไธญๆ˜พ็คบๆˆๅŠŸ่Žทๅพ—ๆŠ˜ๆ‰ฃ,ไฝ†SessionStorage้‡Œ็š„clientDateไป็„ถๆ˜ฏๅฝ“ๅ‰ๆ—ถ้—ด,ๆ‰€ไปฅๆˆ‘ๆœ€ๅŽไป˜ๆฌพๆ—ถไป็„ถๆฒกๆœ‰ๆŠ˜ๆ‰ฃ,ๆ‰€ไปฅๆญค้กนไปปๅŠกๆœชๅฎŒๆˆ. ่€Œๅฆ‚ๆžœๆˆ‘ๅ†ไฟฎๆ”นไธ€ไธ‹Storage้‡Œ็š„ๆ—ถ้—ด,ไปปๅŠกๅฐฑ้€š่ฟ‡ไบ†.

ๆˆ‘ไปŠๅคฉๆ—ฉไธŠๆต‹่ฏ•ไบ†ไธ€ไธ‹ใ€‚ไนŸ่ฎธไฝ ่ฏดๅฏนไบ†๏ผŒๅฆ‚ๆžœๅชไฟฎๆ”นthis.ClientDate็š„่ฏ๏ผŒๆŽฅไธ‹ๆฅ็กฎ่ฎค่ฎขๅ•ไผšๆ˜พ็คบๆŠ˜ๆ‰ฃ๏ผŒไฝ†ไธ‹ๅ•ๆˆๅŠŸ็š„้กต้ขๅˆ™ๆ˜ฏๅŽŸไปทใ€‚

I tested this morning. Maybe youโ€™re right, if I modify this.ClientDate only, the discount show up normally in the order confirmation page, but the discount donโ€™t apply after I submit the order.

ๅฆ‚ๆžœไฟฎๆ”น็ณป็ปŸๆ—ถ้—ด็š„่ฏ๏ผŒไธ‹ๅ•ๅŽๆ‰ไผšๆ˜พ็คบๆญฃๅธธ็š„ๆŠ˜ๆ‰ฃใ€‚

The discount apply successfully only if I change the system time.

ๆˆ‘่ฟ˜ๆฒกๆต‹่ฏ•sessionStorage็š„ไฟฎๆ”นใ€‚ๅฆ‚ๆžœไฟฎๆ”นๅฎŒSession Storageๆ‰่ƒฝๅฎŒๆˆไปปๅŠก็š„่ฏ๏ผŒ้‚ฃๅบ”่ฏฅไธๆ˜ฏBug๏ผŒ่€Œๆ˜ฏๆˆ‘ไธๅคŸ็ป†ๅฟƒใ€‚

I havenโ€™t test the modification of sessionStorage, if the challenge can be solved by editing sessionStorage, it would prove that my careless lead to the"bug".

@chinggg

Read more comments on GitHub >

github_iconTop Results From Across the Web

[ ๐Ÿ› ] A possible bug when solving the challenge "Expired ...
I`ve found a bug when solving the "Expired Coupon" in another way. I found a way to bypass the date validation by using...
Read more >
Bountysource
A possible bug when solving the challenge "Expired Coupon"
Read more >
Expired Coupon (Improper Input Validation) - YouTube
Successfully redeem an expired campaign coupon code.๐Ÿคด Credits to Bjoern Kimminich for providing this excellent vulnerable web app.
Read more >
Best Apps for Students Taking a Break - Top Coupons & Promo ...
AppGrooves has the best coupons, promo codes & discounts for saving money on ... Find out which apps can help you have as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found