0

I have a simple store running on Magento 2.4.6 p2, with guest checkout disabled. I have added Google captcha on registration as well as login form. Still, once in a while, I receive spam orders like this. Spam Order I received

I am unable to find where the vulnerability is on site. How to find out where these orders are getting placed from, and how Magento allows an order to be placed without name of customer.

7
  • Seems like these orders may be placed from some custom code. Try to find custom modules which have code to place order. Commented May 6 at 7:59
  • @MohitKumarArora I have quite a number of modules installed. What should be the best approach to find this ? As there are multiple process to place order in Magento Commented May 6 at 11:12
  • Take a complete backup of Magento files and database. Rename app/etc/env.php and reload magento front end. Commented May 6 at 14:34
  • This will start Magento's readiness check and tell which PHP extension is culprit. You can install that PHP extension and check. Commented May 6 at 14:35
  • If everything goes fine, you can restore files and DB backup. Commented May 6 at 14:36

3 Answers 3

0

To stop this span order, you need to enable Re-captcha on Order Page Using following steps.

  1. Log in to your Magento admin panel
  2. Go to Stores > Settings > Configuration
  3. Open the Customers section. Select the Customer Configuration tab.
  4. In the CAPTCHA section, set Enable CAPTCHA on Frontend to "Yes."
  5. Select Checkout/Place Order options from the list of Forms.
  6. Click Save Config to apply changes.
0

Please add the field validation in checkout_index_index.xml

<referenceBlock name="checkout.root">
            <arguments>
                <argument name="jsLayout" xsi:type="array">
                    <item name="components" xsi:type="array">
                        <item name="checkout" xsi:type="array">
                            <item name="children" xsi:type="array">
                                <item name="steps" xsi:type="array">
                                    <item name="children" xsi:type="array">
                                        <item name="shipping-step" xsi:type="array">
                                            <item name="children" xsi:type="array">
                                                <item name="shippingAddress" xsi:type="array">
                                                    <item name="children" xsi:type="array">
                                                        <item name="shipping-address-fieldset" xsi:type="array">
                                                            <item name="children" xsi:type="array">
                                                                <item name="firstname" xsi:type="array">
                                                                    <item name="validation" xsi:type="array">
                                                                        <item name="validate-alphanum-with-spaces"
                                                                              xsi:type="string">
                                                                            true
                                                                        </item>
                                                                        <item name="max_text_length" xsi:type="number">
                                                                            55
                                                                        </item>
                                                                    </item>
                                                                </item>
                                                                <item name="lastname" xsi:type="array">
                                                                    <item name="validation" xsi:type="array">
                                                                        <item name="validate-alphanum-with-spaces"
                                                                              xsi:type="string">
                                                                            true
                                                                        </item>
                                                                        <item name="max_text_length" xsi:type="number">
                                                                            55
                                                                        </item>
                                                                    </item>
                                                                </item>
                                                                <item name="company" xsi:type="array">
                                                                    <item name="validation" xsi:type="array">
                                                                        <item name="min_text_length" xsi:type="number">
                                                                            0
                                                                        </item>
                                                                        <item name="max_text_length" xsi:type="number">
                                                                            255
                                                                        </item>
                                                                        <item name="validate-alphanum-with-spaces"
                                                                              xsi:type="boolean">
                                                                            true
                                                                        </item>
                                                                    </item>
                                                                </item>
                                                                <item name="city" xsi:type="array">
                                                                    <item name="validation" xsi:type="array">
                                                                        <item name="min_text_length" xsi:type="number">
                                                                            0
                                                                        </item>
                                                                        <item name="max_text_length" xsi:type="number">
                                                                            255
                                                                        </item>
                                                                        <item name="validate-alphanum-with-spaces"
                                                                              xsi:type="boolean">
                                                                            true
                                                                        </item>
                                                                    </item>
                                                                </item>
                                                            </item>
                                                        </item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </item>
                </argument>
            </arguments>
        </referenceBlock>
    ```
0

I was having the same issues. This module has resolved the problems.

https://github.com/DeployEcommerce/module-trojan-order-prevent

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.