CVE-2021-43805
JSON

7.5high

ReDos vulnerability on guest checkout email validation

Severity
7.5high CVSS:3.1 by GitHub_M
Exploit likelihood
1.45% (higher than 74% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-qxmr-qxh6-2cc9

Description

Solidus is a free, open-source ecommerce platform built on Rails. Versions of Solidus prior to 3.1.4, 3.0.4, and 2.11.13 have a denial of service vulnerability that could be exploited during a guest checkout. The regular expression used to validate a guest order's email was subject to exponential backtracking through a fragment like `a.a.` Versions 3.1.4, 3.0.4, and 2.11.13 have been patched to use a different regular expression. The maintainers added a check for email addresses that are no longer valid that will print information about any affected orders that exist. If a prompt upgrade is not an option, a workaround is available. It is possible to edit the file `config/application.rb` manually (with code provided by the maintainers in the GitHub Security Advisory) to check email validity.

Affected

Product or packageVersionsReported by
solidusio solidus>= 3.1.0, < 3.1.4, >= 3.0.0, < 3.0.4, < 2.11.13CVE List
solidus_core (RubyGems)before 2.11.13, from 3.0.0 before 3.0.4, from 3.1.0 before 3.1.4GitHub Advisory Database
nebulab solidusbefore 2.11.13, from 3.0.0 before 3.0.4, from 3.1.0 before 3.1.4NVD

All scores

GitHub_M7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHub7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NVD5.0medium CVSS:2.0AV:N/AC:L/Au:N/C:N/I:N/A:P

Classification

What each source says

CVE List

Solidus is a free, open-source ecommerce platform built on Rails. Versions of Solidus prior to 3.1.4, 3.0.4, and 2.11.13 have a denial of service vulnerability that could be exploited during a guest checkout. The regular expression used to validate a guest order's email was subject to exponential backtracking through a fragment like `a.a.` Versions 3.1.4, 3.0.4, and 2.11.13 have been patched to use a different regular expression. The maintainers added a check for email addresses that are no longer valid that will print information about any affected orders that exist. If a prompt upgrade is not an option, a workaround is available. It is possible to edit the file `config/application.rb` manually (with code provided by the maintainers in the GitHub Security Advisory) to check email validity.

GitHub Advisory Database
Impact

Denial of service vulnerability that could be exploited during a guest checkout. The regular expression used to validate a guest order's email was subject to exponential backtracking through a fragment like a.a..

Before the patch, it can be reproduced in the console like this:

irb(main)> Spree::EmailValidator::EMAIL_REGEXP.match "a@a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.@"
processing time: 54.293660s
=> nil

To reproduce in the browser, fill in the "Customer Email" field with that fake email address during a guest checkout. Before that, you should open the browser dev tools and change the type attribute for that field from email to text. After entering a fake address and pressing the "Save & Continue" button, the browser will take a long term to perform the request before showing an error message for the invalid address. Eventually, making the email string even longer could lead to the exhaustion of server resources.

Patches

Versions 3.1.4, 3.0.4, and 2.11.13 have been patched to use a different regular expression.

There's an improbable chance that some orders in your system end up having associated an email address that is no longer valid. We've added a task to check precisely that:

bin/rails solidus:check_orders_with_invalid_email

The above will print information for every affected order if any.

Workarounds

If a prompt upgrade is not an option, please, add the following to config/application.rb:

config.after_initialize do
  Spree::EmailValidator.send(:remove_const, :EMAIL_REGEXP)
  Spree::EmailValidator::EMAIL_REGEXP = URI::MailTo::EMAIL_REGEXP
end
References
For more information

If you have any questions or comments about this advisory:

NVD (es)

Solidus es una plataforma de comercio electrónico gratuita y de código abierto construida sobre Rails. Las versiones de Solidus anteriores a la 3.1.4, 3.0.4 y 2.11.13 tienen una vulnerabilidad de denegación de servicio que podría ser explotada durante un pedido de invitados. La expresión regular usada para comprender el correo electrónico de un pedido de invitado estaba sujeta a un retroceso exponencial a través de un fragmento como `a.a.` Las versiones 3.1.4, 3.0.4 y 2.11.13 han sido parcheadas para usar una expresión regular diferente. Los mantenedores han añadido una comprobación de las direcciones de correo electrónico que ya no son válidas que imprimirá información sobre los pedidos afectados que se presentan. Si una actualización inmediata no es una opción, se presenta una solución disponible. Es posible editar el archivo "config/application.rb" manualmente (con el código proporcionado por los mantenedores en el aviso de seguridad de GitHub) para comprobar la validez del correo electrónico

References

Sources

SourceRecordLicence
CVE ListCVE-2021-43805 changed 2024-08-04CVE Terms of Use
GitHub Advisory DatabaseGHSA-qxmr-qxh6-2cc9 changed 2026-07-08CC-BY-4.0
NVDCVE-2021-43805 changed 2026-06-17Public domain