Skip to content

Lack of email length validation exposes the website id during customer creation #40842

@ivanaugustobd

Description

@ivanaugustobd

Preconditions and environment

  • A clean install of any Magento version from 2.4.6 to 2.4.9

Steps to reproduce

  1. Navigate to /customer/account/create
  2. Try to create a customer with an e-mail containing 256 characters or more, eg.:
abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.0123456789@abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxy.com

Expected result

An "Email" uses too many characters. or similar exception should be thrown.

Actual result

A raw exception is being thrown instead, exposing the website id in the process:

No such entity with email = abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.0123456789@abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxy.com, websiteId = 1
Image

Found by: Dilnoza (QA team)

Additional information

The customer_entity.email field at database has a 255 char limit, causing the $customerModel->save(); operation at the customer repository to fail silently. The reported raw exception is thrown within the customer repository save() method at app/code/Magento/Customer/Model/ResourceModel/CustomerRepository.php:L320.

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Labels

Area: AccountComponent: CustomerIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Reported on 2.4.9Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

Type

No type
No fields configured for issues without a type.

Projects

Status
Ready for Development

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions