CVE-2021-28680
Ruby vulnerability analysis and mitigation

Overview

The devise_masquerade gem before version 1.3 contains a security vulnerability (CVE-2021-28680) that affects applications using this gem to allow administrators to masquerade/impersonate users. The vulnerability reduces security protection compared to using Devise without this extension. The issue was discovered in December 2020 and fixed in version 1.3.1 (Devise Blog).

Technical details

The vulnerability occurs when the server-side secretkeybase value becomes publicly known. In a standard Devise implementation, an attacker would still need to know a user's password salt to impersonate them. However, with devisemasquerade, an attacker can bypass this requirement by manipulating the session cookie and pretending that a user is already masqueraded by an administrator. This is done by adding and setting the devisemasqueradeuser key to the admin's user ID in the session cookie JSON/Marshal object (Devise Blog, [GitHub Issue](https://github.com/oivoodoo/devisemasquerade/issues/83)).

Impact

If an attacker obtains the secretkeybase value (for example, if it is accidentally committed to a public repository), they can impersonate any user on the system by manipulating session cookies, even without knowing the target user's password salt. This significantly reduces the security of the authentication system (Devise Blog).

Mitigation and workarounds

The vulnerability was fixed in devisemasquerade version 1.3.1 by removing the masquerade back data from the session cookie and storing it in the server's cache instead. Users should upgrade to version 1.3.1 or later to address this security issue ([GitHub Issue](https://github.com/oivoodoo/devisemasquerade/issues/83)).

Additional resources


SourceThis report was generated using AI

Related Ruby vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-4249-gjr8-jpq3HIGH8.7
  • RubyRuby
  • prosemirror_to_html
NoYesNov 13, 2025
CVE-2025-64501HIGH7.6
  • RubyRuby
  • prosemirror_to_html
NoYesNov 10, 2025
GHSA-vfpf-xmwh-8m65HIGH7.6
  • RubyRuby
  • prosemirror_to_html
NoYesNov 07, 2025
GHSA-52c5-vh7f-26fxHIGH7.6
  • RubyRuby
  • prosemirror_to_html
NoYesNov 06, 2025
CVE-2025-12790HIGH7.4
  • RubyRuby
  • mqtt
NoYesNov 06, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management