IPv6 values of X_FORWARDED_FOR in sales orders are truncated to 32 characters.
Preconditions (*)
- Magento 2.4-develop
- When customer is using IPV6 address, the x_forwarded_for IP might get saved only partially into sales_order and quote tables depending on the address str length. Problem appears to be in the x_forwarded_for column length which currently is VARCHAR(32)
- This seems to be a version of the error descripted in #10395 for REMOTE_IP
- Known to exist in our version 2.3.5-p1 but I suspect it probably pre-exists all the way back to at least 2.1.x
Steps to reproduce (*)
1.Customer creates order from an IPv6 address that is longer than 32 characters when IPv6 addresses can be up to 45 characters.
Expected result (*)
- Veiw order for Placed from IP 2600:1700:ec11:1a40:f829:8829:139c:d85f (2600:1700:ec11:1a40:f829:8829:139c:d85f) 2.
Actual result (*)
- Placed from IP 2600:1700:ec11:1a40:f829:8829:139c:d85f (2600:1700:ec11:1a40:f829:8829:13)
- Note the truncated value in () is 32 characters long.
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
- [ S1] Severity: S1 _- A recently installed fraud detection tool used for analyzing the order is detecting that the actual IP and the forwarded IP don't match, and further their API is throwing an error because the forwarded IPv6 value is malformed and thus invalid. Since nearly a third of the traffic coming to our website is IPv6, this issue is hindering our ability to detect fraudulent orders.
Hi @n2diving-dgx. Thank you for your report. To help us process this issue please make sure that you provided the following information:
- Summary of the issue
- Information on your environment
- Steps to reproduce
- Expected and actual results
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
@magento give me 2.4-develop instance - upcoming 2.4.x release
For more details, please, review the Magento Contributor Assistant documentation.
Please, add a comment to assign the issue: @magento I am working on this
- Join Magento Community Engineering Slack and ask your questions in #github channel.
Should be fixed by https://github.com/magento/magento2/pull/27221 that isn't merged yet
#27221 fixes 2.4, but we are going to be on 2.3.x for a while, could we get a backport?
Hi @engcom-Delta. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
-
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
Details
If the issue has a valid description, the labelIssue: Format is validwill be added to the issue automatically. Please, edit issue description if needed, until labelIssue: Format is validappears. -
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add
Issue: Clear Descriptionlabel to the issue by yourself. -
[ ] 3. Add
Component: XXXXXlabel(s) to the ticket, indicating the components it may be related to. -
[ ] 4. Verify that the issue is reproducible on
2.4-developbranchDetails
- Add the comment@magento give me 2.4-develop instanceto deploy test instance on Magento infrastructure.
- If the issue is reproducible on2.4-developbranch, please, add the labelReproduced on 2.4.x.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here! -
[ ] 5. Add label
Issue: Confirmedonce verification is complete. -
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
:white_check_mark: Confirmed by @engcom-Delta
Thank you for verifying the issue. Based on the provided information internal tickets MC-35787 were created
Issue Available: @engcom-Delta, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
Hi @ihor-sviziev. Thank you for working on this issue. Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:
-
- Add/Edit
Component: XXXXXlabel(s) to the ticket, indicating the components it may be related to.
- Add/Edit
-
- Verify that the issue is reproducible on
2.4-developbranchDetails
- Add the comment@magento give me 2.4-develop instanceto deploy test instance on Magento infrastructure.
- If the issue is reproducible on2.4-developbranch, please, add the labelReproduced on 2.4.x.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
- Verify that the issue is reproducible on
-
- If the issue is not relevant or is not reproducible any more, feel free to close it.
- Join Magento Community Engineering Slack and ask your questions in #github channel.
Hi @n2diving-dgx. Thank you for your report. The issue has been fixed in magento/magento2#27221 by @ihor-sviziev in 2.4-develop branch Related commit(s):
- 8ec11ad2e5797eeeafce815d2fbbbd422277d9b1
- 7308ee2a7246d4ae11c140819a30b6bb8db06db0
- 4514e0cc201ac790303142859218d658d2fdd7fc
- aa59e482127642e83b1904e4dff5a29072710a58
The fix will be available with the upcoming 2.4.1 release.