Jump to content

Hack attempt (Order -> total_paid)


Recommended Posts

All,

I changed the DB tables to accept up to about a trillion dollars. Everything in the cart adds up fine. I'm using the cheque payment module.

I add enough items to the cart to hit double digit billions and I get this nasty error:

Hack attempt (Order -> total_paid = 11882196900)

I added

Tools::dieObject($order);

to line 112 in the /classes/PaymentModule.php file, per one of the posts I found here. I then ran 2 orders. 1 that generated the hack attempt and one it would accept. The results are identical. The only thing that changed was the dollar amount.

It's odd that double digit billions trigger a hack attempt, it single digit billions is okay?

Anyone have any idea's on how to fix this?

Thank you!

Link to comment
Share on other sites

Thanks guys, appreciate the responses!

Checking the validate class, it has;
return preg_match('/^[0-9]{1,10}(\.[0-9]{1,9})?$/ui', $price);

I wish I understood this better, but I changed it to:

return preg_match('/^[0-9]{1,12}(\.[0-9]{1,9})?$/ui', $price);

And now it works! Thanks for getting me started in the right direction.

Link to comment
Share on other sites

Just following up...

This does NOT solve the problem. While it did allow large dollar amounts to be placed, it randomly has problems with low dollar amounts. ironically sub-million dollar orders were fine. 10 million (or even billion) was fine. But I kept having the same problems in the million to 3 million range.

As a short term solution, I have disabled this validation. Like with everything else, not sure what long term effects that will have.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...