CVE-2017-7474: Keycloak connect Keycloak-connect And Keycloak-js Improperly Handle Vulnerability

CRITICAL
Advisory Identifier: GHSA-mw35-24gh-f82w
CVSS 9.8
CWE-253
Published
Advisory Summary

CVE-2017-7474 is a CRITICAL (CVSS 9.8) keycloak-connect and keycloak-js improperly handle vulnerability (CWE-253: Incorrect Check of Function Return Value) affecting Keycloak connect libraries in the npm ecosystem. The issue involves keycloak-connect and keycloak-js improperly handle invalid tokens. Remediation is available by upgrading affected packages to version 3.1.0.

CVE-2017-7474 at a Glance

CVE Identifier CVE-2017-7474
GHSA Identifier GHSA-mw35-24gh-f82w
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-253: Incorrect Check of Function Return Value
Affected Product Keycloak connect
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 9.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2017-7474

To remediate this vulnerability, upgrade all affected Keycloak connect dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

keycloak-connect fixed: 3.1.0
npm install keycloak-connect@3.1.0
keycloak-js fixed: 3.1.0
npm install keycloak-js@3.1.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls keycloak-connect

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2017-7474, inspect your project dependencies using npm:

npm ls keycloak-connect

Analyze the terminal output to locate any version of Keycloak connect in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.1.0), your application is affected.

Note: The npm ls keycloak-connect command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-253: Incorrect Check of Function Return Value, where the product incorrectly checks a return value from a function, which prevents it from detecting errors or exceptional conditions. In Keycloak connect, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

It was found that the Keycloak Node.js adapter 2.5 - 3.0 did not handle invalid tokens correctly. An attacker could use this flaw to bypass authentication and gain access to restricted information, or to possibly conduct further attacks.

CVE-2017-7474 Affected Keycloak connect Versions

2 component(s)
Fixed Versions:
3.1.0
Product / Package Ecosystem Affected Versions Fixed Version
keycloak-connect
npm
≥ 2.5.0
< 3.1.0
3.1.0
keycloak-js
npm
≥ 2.5.0
< 3.1.0
3.1.0

References

Frequently Asked Questions

What is CVE-2017-7474?
CVE-2017-7474 is a security vulnerability in Keycloak connect involving keycloak-connect and keycloak-js improperly handle invalid tokens under CWE-253: Incorrect Check of Function Return Value.
Which Keycloak connect versions are affected?
Affected versions include releases prior to 3.1.0 across affected packages: keycloak-connect, keycloak-js.
What version fixes CVE-2017-7474?
Upgrading to 3.1.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is keycloak-connect affected?
Yes, keycloak-connect is affected in releases prior to 3.1.0. Upgrade your dependency to 3.1.0 or later.
Is keycloak-js affected?
Yes, keycloak-js is affected in releases prior to 3.1.0. Upgrade your dependency to 3.1.0 or later.
What is the CVSS score of CVE-2017-7474?
CVE-2017-7474 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2017-7474?
CVE-2017-7474 is classified under CWE-253: Incorrect Check of Function Return Value (The product incorrectly checks a return value from a function, which prevents it from detecting errors or exceptional conditions.).
How can I check npm dependencies for CVE-2017-7474?
Run the dependency tree command: 'npm ls keycloak-connect'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-mw35-24gh-f82w",
  "modified" : "2023-09-08T19:56:20Z",
  "published" : "2017-11-15T20:41:51Z",
  "aliases" : [ "CVE-2017-7474" ],
  "summary" : "keycloak-connect and keycloak-js improperly handle invalid tokens",
  "details" : "It was found that the Keycloak Node.js adapter 2.5 - 3.0 did not handle invalid tokens correctly.  An attacker could use this flaw to bypass authentication and gain access to restricted information, or to possibly conduct further attacks.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "keycloak-connect"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.5.0"
      }, {
        "fixed" : "3.1.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "keycloak-js"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.5.0"
      }, {
        "fixed" : "3.1.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-7474"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=1445271"
  }, {
    "type" : "WEB",
    "url" : "http://rhn.redhat.com/errata/RHSA-2017-1203.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-253" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:47:26Z",
    "nvd_published_at" : null
  }
}