CVE-2017-7474: Keycloak Node.js adapter invalid token handling bypass

CVE-2017-7474 · Severity: low · CVSS 3 · Published 2017-11-15

Keycloak's Node.js authentication adapters failed to properly validate authentication tokens, allowing attackers to bypass login checks and gain unauthorized access to protected resources. This affects applications using Keycloak for centralized identity management, potentially exposing sensitive data and enabling further attacks without valid credentials.

Technologies: keycloak-connect (npm). Vendors: npm.

Quick answers

Is CVE-2017-7474 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2017-7474 being exploited in the wild.
How severe is CVE-2017-7474?
Low severity, with a CVSS score of 3, published 15 November 2017.
Which products and versions are affected?
keycloak-connect (npm) SEMVER:introduced=2.5.0,fixed=3.1.0; keycloak-js (npm) SEMVER:introduced=2.5.0,fixed=3.1.0.
Is there a fix for CVE-2017-7474?
Yes. keycloak-connect (npm): upgrade to 3.1.0 or later; keycloak-js (npm): upgrade to 3.1.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2017-7474 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2017-7474?
Check whether you run keycloak-connect (npm) or keycloak-js (npm) 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

  • keycloak-connect (npm): upgrade to 3.1.0 or later
    npm install keycloak-connect@3.1.0
  • keycloak-js (npm): upgrade to 3.1.0 or later
    npm install keycloak-js@3.1.0

Technical details

The vulnerability is a token validation bypass (CWE-253: Improper Check of Insufficient Control Flow Management) in the Node.js adapter's grant manager. The validateGrant() function did not properly check token expiration and validity, allowing attackers to supply invalid or expired tokens that would be accepted by the application. The flaw affects keycloak-connect and keycloak-js versions 2.5.0 through 3.0.x and requires no authentication or user interaction—any attacker with network access to the affected application can exploit it. By bypassing token validation, attackers gain unauthorized access to restricted functionality and data. The vulnerability was fixed in version 3.1.0.

Affected products

  • Keycloak keycloak-connect 2.5.0 to 3.0.x
  • Keycloak keycloak-js 2.5.0 to 3.0.x

Identifiers

  • CVE-2017-7474
  • GHSA-mw35-24gh-f82w

Timeline

  • 2017-04-25: disclosed: Vulnerability reported to Red Hat
  • 2017-11-15: advisory: GHSA advisory published
  • 2017-05-08: patched: Fix released in version 3.1.0; Red Hat RHSA-2017:1203 issued

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.