0

I am using Magento 2.4.7-p1 hackers are trying to place order using guest cart REST API carding attacks tried cloudflare , rate limit magento and captcha also, but no use in braintree created so many rules, but no use.

As per our analysis, this request will be used while making orders from APIs not from the front end if we disable this API from the code level under this file.

vendor/magento/module-quote/etc/webapi.xml

Code to comment is below.

###############################################

################################################

disabled above code still carding attack is running.

https://community.magento.com/t5/Magento-2-x-Technical-Issues/rest-default-V1-guest-carts-open-to-DDOS/td-p/421447

can any one please tell how to stop guest order rest api

0

2 Answers 2

0

They can try as many times as they want, if you upgrade your magento 2 to latest security patch releases...they will be blocked by Content Security Policies. More details in CSP ASPB Security Patch

answered Dec 27, 2024 at 11:10
1
  • already, i am using latest version and enabled csp Commented Dec 27, 2024 at 11:38
0

Several solutions:

  • Turn off guest checkouts completely at Stores > Configuration > Sales > Checkout > Checkout Options > Allow guest checkout:

enter image description here

  • Programmatically block guest API orders.

vendor/magento/module-quote/Model/GuestCart/GuestCartManagement.php:

 public function placeOrder($cartId, PaymentInterface $paymentMethod = null)
 { 
+ return; //add this return and remove the plus sign
 $quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id');
 $this->cartRepository->get($quoteIdMask->getQuoteId())
 ->setCheckoutMethod(CartManagementInterface::METHOD_GUEST);
 return $this->quoteManagement->placeOrder($quoteIdMask->getQuoteId(), $paymentMethod);
 } 
answered Jan 27 at 20:44

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.