Summary
ReDos vulnerability on guest checkout email validation
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:
- Open an issue or a discussion in Solidus.
- Email us at [email protected]
- Contact the core team on Slack
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 "[email protected].@"
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.
A regular expression with worst-case exponential or polynomial matching time is applied to untrusted input, causing excessive CPU use. Typical impact: denial of service when input is crafted to trigger backtracking.
CVE-2021-43805 has a CVSS score of 7.5 (High). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (2.11.13, 3.0.4, 3.1.4); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
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.
Frequently Asked Questions
- What is CVE-2021-43805? CVE-2021-43805 is a high-severity inefficient regular expression (ReDoS) vulnerability in solidus_core (rubygems), affecting versions < 2.11.13. It is fixed in 2.11.13, 3.0.4, 3.1.4. A regular expression with worst-case exponential or polynomial matching time is applied to untrusted input, causing excessive CPU use.
- How severe is CVE-2021-43805? CVE-2021-43805 has a CVSS score of 7.5 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of solidus_core are affected by CVE-2021-43805? solidus_core (rubygems) versions < 2.11.13 is affected.
- Is there a fix for CVE-2021-43805? Yes. CVE-2021-43805 is fixed in 2.11.13, 3.0.4, 3.1.4. Upgrade to this version or later.
- Is CVE-2021-43805 exploitable, and should I be worried? Whether CVE-2021-43805 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2021-43805 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2021-43805?
- Upgrade
solidus_coreto 2.11.13 or later - Upgrade
solidus_coreto 3.0.4 or later - Upgrade
solidus_coreto 3.1.4 or later
- Upgrade