CVE-2022-46177:Discourse password reset can be used to take over an account if a user changes their primary email while a reset link remains valid, due to insufficient session expiration in the reset flow. Affected versions include < 2.8.14 and >= 2.9.0.beta0, < 3.0.0.beta16, with patches available in 2.8.14 and 3.0.0.beta15. A workaround is to reduce the email_token_valid_hours window.

splash
Back

Description Preview

Discourse contains a vulnerability in its password reset workflow where, if a user requests a password reset email and then changes their primary email, the previously issued reset email can still be used to reset the password. This can re-link the account’s primary email to the old address, potentially enabling account takeover if the old email is compromised or owned by another party. The issue stems from insufficient session expiration for reset tokens. The advisory notes that upgrading to patched versions—2.8.14 or 3.0.0.beta15—mitigates the problem, and the defect is mitigated by the site setting email_token_valid_hours (default 48 hours). As a workaround, administrators can lower this value to reduce the window during which an old reset link remains usable.

Overview

This vulnerability affects Discourse’s password reset mechanism by allowing an attacker to leverage a still-valid reset link after the user changes the account’s primary email, potentially leading to an account takeover. The root cause is insufficient expiration of password reset tokens. It affects releases prior to 2.8.14 on the stable branch and prior to 3.0.0.beta16 on the beta/tests branches; patches are provided in 2.8.14 and 3.0.0.beta15. The default 48-hour validity for email tokens contributes to the risk, and reducing this window is suggested as a workaround if upgrading is not immediately possible.

Remediation

  1. Upgrade to the patched releases: Discourse 2.8.14 or 3.0.0.beta15 (or later).
  2. If an immediate upgrade is not feasible, reduce the email_token_valid_hours setting to a shorter window to limit token validity.
  3. After applying a fix, validate password reset flows to ensure tokens are invalidated when a user changes their primary email.
  4. Audit accounts with recent email changes and monitor for any suspicious password resets or account activity.
  5. Plan and test a full upgrade path to maintain future security fixes and mitigations.

References

  • https://github.com/discourse/discourse/security/advisories/GHSA-5www-jxvf-vrc3
  • https://github.com/discourse/discourse/commit/4bf306f0e3bf54a9ef9c5886bf1cfb85c20da570
  • https://github.com/discourse/discourse/commit/83944213b2b2454af80d0407f60d67641b1f0b38

Industry ExposureMost to least
This section illustrates the prevalence of a specific Common Vulnerabilities and Exposures (CVE) across various industries based on customer reports. The ranking displays industries from the most to least affected by this particular vulnerability, offering valuable insight into where this CVE has been most frequently observed. This information can help organizations within these sectors prioritize their security efforts, understand their relative risk exposure compared to their peers, and focus remediation strategies where they are most needed. By understanding the industry-specific impact, organizations can make more informed decisions regarding patching, resource allocation, and overall risk management related to this CVE.

  1. Accommodation & Food Services: Low
    Accommodation & Food Services
  2. Administrative, Support, Waste Management & Remediation Services: Low
    Administrative, Support, Waste Management & Remediation Services
  3. Agriculture, Forestry Fishing & Hunting: Low
    Agriculture, Forestry Fishing & Hunting
  4. Arts, Entertainment & Recreation: Low
    Arts, Entertainment & Recreation
  5. Construction: Low
    Construction
  6. Educational Services: Low
    Educational Services
  7. Finance and Insurance: Low
    Finance and Insurance
  8. Health Care & Social Assistance: Low
    Health Care & Social Assistance
  9. Information: Low
    Information
  10. Management of Companies & Enterprises: Low
    Management of Companies & Enterprises
  11. Manufacturing: Low
    Manufacturing
  12. Mining: Low
    Mining
  13. Other Services (except Public Administration): Low
    Other Services (except Public Administration)
  14. Professional, Scientific, & Technical Services: Low
    Professional, Scientific, & Technical Services
  15. Public Administration: Low
    Public Administration
  16. Real Estate Rental & Leasing: Low
    Real Estate Rental & Leasing
  17. Retail Trade: Low
    Retail Trade
  18. Transportation & Warehousing: Low
    Transportation & Warehousing
  19. Utilities: Low
    Utilities
  20. Wholesale Trade: Low
    Wholesale Trade

Focus on What Matters

  1. See Everything.
  2. Identify True Risk.
  3. Proactively Mitigate Threats.

Let's talk!

background