magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

IPv6 values of X_FORWARDED_FOR in sales orders are truncated to 32 characters.

Open n2diving-net opened this issue 6 years ago • 7 comments

Preconditions (*)

  1. Magento 2.4-develop
  2. 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)
  3. This seems to be a version of the error descripted in #10395 for REMOTE_IP
  4. 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 (*)

  1. 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 (*)

  1. Placed from IP 2600:1700:ec11:1a40:f829:8829:139c:d85f (2600:1700:ec11:1a40:f829:8829:13)
  2. 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.

n2diving-net avatar Jun 11 '20 18:06 n2diving-net

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


m2-assistant[bot] avatar Jun 11 '20 18:06 m2-assistant[bot]

Should be fixed by https://github.com/magento/magento2/pull/27221 that isn't merged yet

ihor-sviziev avatar Jun 17 '20 06:06 ihor-sviziev

#27221 fixes 2.4, but we are going to be on 2.3.x for a while, could we get a backport?

n2diving-net avatar Jun 17 '20 11:06 n2diving-net

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).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • [ ] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • [ ] 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced 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: Confirmed once verification is complete.

  • [ ] 6. Make sure that automatic system confirms that report has been added to the backlog.

m2-assistant[bot] avatar Jul 10 '20 13:07 m2-assistant[bot]

: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.

magento-engcom-team avatar Jul 10 '20 13:07 magento-engcom-team

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:

    1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
    1. Verify that the issue is reproducible on 2.4-develop branch
      Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
      - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced 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!
    1. If the issue is not relevant or is not reproducible any more, feel free to close it.

m2-assistant[bot] avatar Jul 21 '20 18:07 m2-assistant[bot]

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):

The fix will be available with the upcoming 2.4.1 release.

magento-engcom-team avatar Jul 23 '20 08:07 magento-engcom-team