{"id":"CVE-2021-28680","aliases":["CVE-2021-28680","GHSA-25f5-gc4h-hc22"],"related":[],"kind":"vulnerability","state":"published","title":"Improper Privilege Management in devise_masquerade","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"devise_masquerade gem versiones anteriores a 1.3, permite determinados ataques cuando se desconoce el salt de una contraseña. Una aplicación que usa esta gema para permitir a administradores enmascarar/impersonar a usuarios pierde una capa de protección de seguridad en comparación con una situación en la que se usa Devise (sin esta extensión). Si el valor de secret_key_base del lado del servidor se hace públicamente conocido (por ejemplo, si es comprometido a un repositorio público por error), todavía se presentan otras protecciones en el lugar que impiden a un atacante hacerse pasar por cualquier usuario en el sitio. Cuando no se usa el enmascaramiento en una aplicación devise_masquerade, uno debe conocer el salt de la contraseña del usuario objetivo si quiere cifrar y firmar una cookie de sesión válida. Sin embargo, cuando es usada devise_masquerade, un atacante puede decidir a qué usuario volverá la acción \"back\" sin conocer el salt de la contraseña de ese usuario y simplemente conociendo el ID del usuario, al manipular la cookie de sesión y fingiendo que un usuario ya está enmascarado por un administrador","source":"nvd"}],"published":"2021-12-07T20:32:18.000Z","modified":"2026-06-17T03:46:46.963Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","score":8.1,"rating":"HIGH"},"severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","score":8.1,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","score":8.1,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:M/Au:N/C:P/I:P/A:P","score":6.8,"rating":"MEDIUM"}],"cwes":["CWE-269"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.3.1"}],"ecosystem":"RubyGems","package":"devise_masquerade","purl":"pkg:gem/devise_masquerade","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"1.3.0"}],"vendor":"devise_masquerade_project","product":"devise_masquerade","cpe":"cpe:2.3:a:devise_masquerade_project:devise_masquerade:*:*:*:*:*:ruby:*:*","source":"nvd"}],"references":[{"url":"https://labanskoller.se/blog/2021/03/23/the-devise-extension-that-peeled-off-one-layer-of-the-security-onion-cve-2021-28680/","tags":["exploit","third-party-advisory","x-refsource-misc","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://github.com/oivoodoo/devise_masquerade/issues/83","tags":["issue-tracking","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-28680","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/oivoodoo/devise_masquerade/pull/76","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/oivoodoo/devise_masquerade","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/oivoodoo/devise_masquerade/releases/tag/v1.3.1","tags":["web"],"sources":["ghsa"]},{"url":"https://labanskoller.se/blog/2021/03/23/the-devise-extension-that-peeled-off-one-layer-of-the-security-onion-cve-2021-28680","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"mitre","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-28680","url":"https://www.cve.org/CVERecord?id=CVE-2021-28680","licence":"CVE Terms of Use","modified":"2024-08-03T21:47:33.085Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-25f5-gc4h-hc22","url":"https://github.com/advisories/GHSA-25f5-gc4h-hc22","licence":"CC-BY-4.0","modified":"2024-02-18T05:32:24.990Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-28680","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-28680","licence":"Public domain","modified":"2026-06-17T03:46:46.963Z"}],"updatedAt":"2026-11-25T22:58:05.859Z","epss":{"score":0.0125,"percentile":0.70223,"date":"2026-12-01T12:00:22.000Z"}}