# CVE-2016-6582: Doorkeeper gem improper OAuth 2.0 token revocation implementation

Source: https://junglewise.ai/threats/cve-2016-6582-doorkeeper-gem-improper-oauth-2-0-token-revocation-implementation  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2017-01-23. Updated: 2026-05-13  
License: CC BY 4.0 with a link back

CVE-2016-6582 · Severity: critical · CVSS 9.1 · Published 2017-01-23

Doorkeeper, a popular Ruby library used to manage OAuth 2.0 authentication in Rails applications, failed to correctly implement secure token revocation. This flaw means that when a user logs out, their session tokens might not actually be deactivated, allowing an attacker who has previously hijacked a session to continue accessing the account. Additionally, certain configurations could allow unauthorized parties to deactivate tokens belonging to other users, potentially disrupting service.

Technologies: [doorkeeper (RubyGems)](https://junglewise.ai/threats/technologies/rubygems-doorkeeper). Vendors: [RubyGems](https://junglewise.ai/threats/vendors/rubygems).

## Quick answers

**Is CVE-2016-6582 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2016-6582 being exploited in the wild.

**How severe is CVE-2016-6582?** Critical severity, with a CVSS score of 9.1, published 23 January 2017.

**Which products and versions are affected?** doorkeeper (RubyGems) ECOSYSTEM:introduced=0,fixed=4.2.0.

**Is there a fix for CVE-2016-6582?** Yes. doorkeeper (RubyGems): upgrade to 4.2.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2016-6582 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2016-6582?** Check whether you run Doorkeeper Project Doorkeeper or doorkeeper (RubyGems) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- doorkeeper (RubyGems): upgrade to 4.2.0 or later

  ```sh
  bundle update doorkeeper
  ```


## Technical details

The Doorkeeper gem (versions 1.2.0 to 4.1.0) contains a logic error in its implementation of RFC 7009. Specifically, it failed to revoke tokens for public clients making unauthenticated calls and incorrectly used Bearer token authentication instead of client credential authentication for revocation requests. This root cause prevents proper authorization of confidential clients, meaning they could not securely verify ownership of a token before revoking it. An attacker can exploit this to replay hijacked sessions after a victim attempts to log out, or potentially revoke arbitrary tokens if they have compromised a confidential client. The issue is resolved in version 4.2.0.

## Affected products

- Doorkeeper Project Doorkeeper 1.2.0 through 4.1.0

## Identifiers

- CVE-2016-6582
- GHSA-3m6r-39p3-jq25

## Timeline

- 2016-08-03: disclosed: Bug discovered and privately disclosed to maintainer
- 2016-08-18: patched: Version 4.2.0 released
- 2017-01-23: advisory: NVD publication date

## References

- [http://packetstormsecurity.com/files/138430/Doorkeeper-4.1.0-Token-Revocation.html](http://packetstormsecurity.com/files/138430/Doorkeeper-4.1.0-Token-Revocation.html)
- [http://seclists.org/fulldisclosure/2016/Aug/105](http://seclists.org/fulldisclosure/2016/Aug/105)
- [http://www.securityfocus.com/archive/1/539268/100/0/threaded](http://www.securityfocus.com/archive/1/539268/100/0/threaded)
- [http://www.securityfocus.com/bid/92551](http://www.securityfocus.com/bid/92551)
- [https://github.com/doorkeeper-gem/doorkeeper/issues/875](https://github.com/doorkeeper-gem/doorkeeper/issues/875)
- [https://github.com/doorkeeper-gem/doorkeeper/releases/tag/v4.2.0](https://github.com/doorkeeper-gem/doorkeeper/releases/tag/v4.2.0)

## Related threats

- [Doorkeeper Improper Authentication vulnerability](https://junglewise.ai/threats/cve-2023-34246-doorkeeper-improper-authentication-vulnerability)
- [Exposure of Sensitive Information to an Unauthorized Actor in Doorkeeper](https://junglewise.ai/threats/cve-2020-10187-exposure-of-sensitive-information-to-an-unauthorized-actor-in)
- [Doorkeeper vulnerable to Cross-site Request Forgery](https://junglewise.ai/threats/cve-2014-8144-doorkeeper-vulnerable-to-cross-site-request-forgery)
- [Moderate severity vulnerability that affects doorkeeper](https://junglewise.ai/threats/moderate-severity-vulnerability-that-affects-doorkeeper-a7990bec)
- [Doorkeeper subject to Incorrect Permission Assignment](https://junglewise.ai/threats/cve-2018-1000211-doorkeeper-subject-to-incorrect-permission-assignment)
