Challenge:
Name: Payback Time
Description: Place an order that makes you rich.
Difficulty: 3 star
Category: Improper Input Validation
Expanded Description: https://pwning.owasp-juice.shop/part2/improper-input-validation.html
Tools used:
Burp, FoxyProxy
Resources used:
None.
Methodology:
In this challenge, the expanded description isn’t of much use. Instead of taking suggestions from the description as I normally would, I opted to look at the packets being sent to the server during the purchase process. First I added the most expensive item in the store to my basket and checked what information was being passed.
![Burp Project Intruder Repeater Window
Dashboard Target
Intruder
Help Logger++ H IT P Request Smuggler
Sequencer Decoder
Repeater
Comparer
history Options
Extende
HIT P history WebSockets
Request to http://localhost:3000
Forward
Params
Drop
Headers
[127001]
tercept o
ISON web Tokens
Action
Open Browser
Raw An I Actions
Pretty
1 POST /api/aasketltems/ H-rrp/l.l
Host: local host 3000
User-Agent: MoziIIa/S.O (X
11; Linux x86 64;
application/ j son, text/ plain,
4 Accept
S Accept -Language: en-lJS,
Accept -Encoding: gzip, deflate
rv.78.o)
Gecko,'20100101 Firefox,'78.o
Authorization: Bearer eyJOeXAiOiJKVIQiLCJhbGciOiJSUzIINiJ9. eyJzdGFOdXMiOiJzdRNj Z.XI'
Content -Type: application/ j son
Content -Length: 44
10 Origin: http://localhost : 3000
Il Connection: close
Referer: http://localhost : 3000/
IS Cookle: language=en; welcomebanner status=dismiss;
"Product Idl
' aasketld
quantity
cookleconsent
status=dismiss,](https://curiositykillscolby.files.wordpress.com/2020/11/image-69.jpeg?w=595)
The “quantity” field stood out like a sore thumb, so I decided to see what would happen if, instead of 1, I added -111 items to my basket.

Well that looks promising.

At this point it was fairly clear that pressing “Pay -xxx.xx” would be the easiest way to transfer that money into my account. This method is much easier than, say, adding that money onto a credit card.

After entering my user’s name and address, I placed the order and completed the challenge.

Prevention and mitigation strategies:
Lessons Learned and Things Worth Mentioning:
- There is no reason to assume that a field which should be a positive value is enforced as such on the server side. While I couldn’t add -1 items from the user interface, using Burp Suite it was a trivial task to complete. One which was very lucrative in Juice Shop currency, which unfortunately has no exchange rate to USD.