CVE-2019-10157: Keycloak connect Remote Code Execution Vulnerability

MODERATE
Advisory Identifier: GHSA-68hw-vfh7-xvg8
CVSS 5.5
CWE-287 CWE-345
Published
Advisory Summary

CVE-2019-10157 is a MODERATE (CVSS 5.5) remote code execution vulnerability (CWE-287: Improper Authentication) affecting Keycloak connect libraries in the npm ecosystem. The issue involves forced logout in keycloak-connect. Remediation is available by upgrading affected packages to version 4.8.3.

CVE-2019-10157 at a Glance

CVE Identifier CVE-2019-10157
GHSA Identifier GHSA-68hw-vfh7-xvg8
Severity MODERATE
CVSS v3.1 Base Score 5.5
CWE Classification CWE-287: Improper Authentication
Affected Product Keycloak connect
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.5

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

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

How to Fix CVE-2019-10157

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: 4.8.3
npm install keycloak-connect@4.8.3
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-2019-10157, 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 4.8.3), 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-287: Improper Authentication, where when an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct. 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

Versions of `keycloak-connect` prior to 4.4.0 are vulnerable to Forced Logout. The package fails to validate JWT signatures on the `/k_logout` route, allowing attackers to logout users and craft malicious JWTs with NBF values that prevent user access indefinitely. ## Recommendation Upgrade to version 4.4.0 or later.

CVE-2019-10157 Affected Keycloak connect Versions

1 component(s)
Fixed Versions:
4.8.3
Product / Package Ecosystem Affected Versions Fixed Version
keycloak-connect
npm
< 4.8.3
4.8.3

References

Frequently Asked Questions

What is CVE-2019-10157?
CVE-2019-10157 is a security vulnerability in Keycloak connect involving Forced Logout in keycloak-connect under CWE-287: Improper Authentication.
Which Keycloak connect versions are affected?
Affected versions include releases prior to 4.8.3 across affected packages: keycloak-connect.
What version fixes CVE-2019-10157?
Upgrading to 4.8.3 (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 4.8.3. Upgrade your dependency to 4.8.3 or later.
What is the CVSS score of CVE-2019-10157?
CVE-2019-10157 has a CVSS v3.1 base score of 5.5 (MODERATE) with vector string CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2019-10157?
CVE-2019-10157 is classified under CWE-287: Improper Authentication (When an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct.).
How can I check npm dependencies for CVE-2019-10157?
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-68hw-vfh7-xvg8",
  "modified" : "2021-08-16T15:25:07Z",
  "published" : "2019-06-13T20:38:09Z",
  "aliases" : [ "CVE-2019-10157" ],
  "summary" : "Forced Logout in keycloak-connect",
  "details" : "Versions of `keycloak-connect` prior to 4.4.0 are vulnerable to Forced Logout. The package fails to validate JWT signatures on the `/k_logout` route, allowing attackers to logout users and craft malicious JWTs with NBF values that prevent user access indefinitely.\n\n\n## Recommendation\n\nUpgrade to version 4.4.0 or later.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "keycloak-connect"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.8.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-10157"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/keycloak/keycloak-nodejs-connect/commit/55e54b55d05ba636bc125a8f3d39f0052d13f8f6"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2019-10157"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/SNYK-JS-KEYCLOAKNODEJSCONNECT-449920"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/978"
  }, {
    "type" : "WEB",
    "url" : "http://www.securityfocus.com/bid/108734"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-287", "CWE-345" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2019-06-13T20:28:41Z",
    "nvd_published_at" : "2019-06-12T14:29:00Z"
  }
}