Vulnerabilities in pkg:gem/bootstrap-wysihtml5-rails

PACKAGE
Advisory Identifier: GHSA-w457-6q6x-cgp9
Advisory Summary

CVE-2019-19919 is a CRITICAL (CVSS 9.8) prototype pollution vulnerability (CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')) affecting Handlebars libraries in the npm ecosystem. The issue involves prototype pollution in handlebars. Remediation is available by upgrading affected packages to version 4.3.0, 3.0.8.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:gem/bootstrap-wysihtml5-rails

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:gem/bootstrap-wysihtml5-rails. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-w457-6q6x-cgp9 CVE-2019-19919 CRITICAL Prototype Pollution in handlebars

CVE-2019-19919 at a Glance

CVE Identifier CVE-2019-19919
GHSA Identifier GHSA-w457-6q6x-cgp9
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
Affected Product Handlebars
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.1/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-2019-19919

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

handlebars fixed: 4.3.0
npm install handlebars@4.3.0
bootstrap-wysihtml5-rails fixed: Latest secure release
Upgrade bootstrap-wysihtml5-rails to Latest secure release
handlebars fixed: 3.0.8
npm install handlebars@3.0.8
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 handlebars

How to Check if You Are Affected

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

npm ls handlebars

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

Note: The npm ls handlebars 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-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution'), where the product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype. In Handlebars, 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 `handlebars` prior to 3.0.8 or 4.3.0 are vulnerable to Prototype Pollution leading to Remote Code Execution. Templates may alter an Objects' `__proto__` and `__defineGetter__` properties, which may allow an attacker to execute arbitrary code through crafted payloads. ## Recommendation Upgrade to version 3.0.8, 4.3.0 or later.

CVE-2019-19919 Affected Handlebars Versions

3 component(s)
Fixed Versions:
4.3.03.0.8
Product / Package Ecosystem Affected Versions Fixed Version
handlebars
npm
≥ 4.0.0
< 4.3.0
4.3.0
bootstrap-wysihtml5-rails
RubyGems
≥ 0.3.3.5
≤ 0.3.3.8
handlebars
npm
< 3.0.8
3.0.8

References

Frequently Asked Questions

What is CVE-2019-19919?
CVE-2019-19919 is a security vulnerability in Handlebars involving Prototype Pollution in handlebars under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution').
Which Handlebars versions are affected?
Affected versions include releases prior to 4.3.0, 3.0.8 across affected packages: handlebars, bootstrap-wysihtml5-rails.
What version fixes CVE-2019-19919?
Upgrading to 4.3.0, 3.0.8 (or the latest patched release for your respective branch) resolves the vulnerability.
Is handlebars affected?
Yes, handlebars is affected in releases prior to 4.3.0, 3.0.8. Upgrade your dependency to 4.3.0, 3.0.8 or later.
Is bootstrap-wysihtml5-rails affected?
Yes, bootstrap-wysihtml5-rails is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2019-19919?
CVE-2019-19919 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2019-19919?
CVE-2019-19919 is classified under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution') (The product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype.).
How can I check npm dependencies for CVE-2019-19919?
Run the dependency tree command: 'npm ls handlebars'. 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-w457-6q6x-cgp9",
  "modified" : "2022-06-06T17:16:15Z",
  "published" : "2019-12-26T17:58:13Z",
  "aliases" : [ "CVE-2019-19919" ],
  "summary" : "Prototype Pollution in handlebars",
  "details" : "Versions of `handlebars` prior to 3.0.8 or 4.3.0 are vulnerable to Prototype Pollution leading to Remote Code Execution. Templates may alter an Objects' `__proto__` and `__defineGetter__` properties, which may allow an attacker to execute arbitrary code through crafted payloads.\n\n\n## Recommendation\n\nUpgrade to version 3.0.8, 4.3.0 or later.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "handlebars"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0"
      }, {
        "fixed" : "4.3.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "bootstrap-wysihtml5-rails"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.3.3.5"
      }, {
        "last_affected" : "0.3.3.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "handlebars"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.0.8"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-19919"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/wycats/handlebars.js/issues/1558"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/handlebars-lang/handlebars.js/commit/156061eb7707575293613d7fdf90e2bdaac029ee"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/handlebars-lang/handlebars.js/commit/90ad8d97ad2933852fb83fcc054699dc99e094db"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/wycats/handlebars.js/commit/2078c727c627f25d4a149962f05c1e069beb18bc"
  }, {
    "type" : "WEB",
    "url" : "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-19919"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Nerian/bootstrap-wysihtml5-rails/blob/master/vendor/assets/javascripts/bootstrap-wysihtml5/handlebars.runtime.min.js"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Nerian/bootstrap-wysihtml5-rails/tree/master/vendor/assets/javascripts/bootstrap-wysihtml5"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/bootstrap-wysihtml5-rails/CVE-2019-19919.yml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/wycats/handlebars.js"
  }, {
    "type" : "WEB",
    "url" : "https://www.tenable.com/security/tns-2021-14"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1321", "CWE-74" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2019-12-26T17:55:40Z",
    "nvd_published_at" : "2019-12-20T23:15:00Z"
  }
}