.. / handlebars
Star Fork

Handlebars provides the power necessary to let you build semantic templates effectively with no frustration. Handlebars is largely compatible with Mustache templates. In most cases it is possible to swap out Mustache with Handlebars and continue using your current templates.

handlebars.js
handlebars-lang
...

Latest

<any> <a> @href @any ⏱️ func-parameter

≤4.7.6 | CVE-2021-23369

<any> @any 🛡️ unsafe-eval ⏱️ func-parameter
More information

Root Cause

Source: https://github.com/handlebars-lang/handlebars.js/blob/e6ad93ea01bcde1f8ddaa4b4ebe572dd616abfaa/lib/handlebars/runtime.js#L121

strict: function(obj, name, loc) {
  if (!obj || !(name in obj)) {
    throw new Exception('"' + name + '" not defined in ' + obj, {
      loc: loc
    });
  }
  return obj[name];
},

Related links:

Found by Francois Lajeunesse-Robert.


≤3.0.7&≤4.5.1 | CVE-2019-20920

<any> @any 🛡️ unsafe-eval ⏱️ func-parameter
More information

Root Cause

Source: https://github.com/handlebars-lang/handlebars.js/blob/v4.5.1/lib/handlebars/helpers/lookup.js

export default function(instance) {
  instance.registerHelper('lookup', function(obj, field) {
    if (!obj) {
      return obj;
    }
    if (field === 'constructor' && !obj.propertyIsEnumerable(field)) {
      return undefined;
    }
    return obj[field];
  });
}

Related links:

Found by Francois Lajeunesse-Robert.


≤4.0.13

<any> @any 🛡️ unsafe-eval ⏱️ func-parameter
More information

Root Cause

Source: https://github.com/handlebars-lang/handlebars.js/blob/8d22e6f501dc0720fe0610bb4dab60cae18e7d20/lib/handlebars/compiler/javascript-compiler.js#L15

nameLookup: function(parent, name/* , type*/) {
  if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) {
    return [parent, '.', name];
  } else {
    return [parent, '[', JSON.stringify(name), ']'];
  }
}

Related links:

Found by Mahmoud Gamal.


≤3.0.7&≤4.2.2 | CVE-2019-19919

<any> @any 🛡️ unsafe-eval ⏱️ func-parameter
More information

Root Cause

Source: https://github.com/handlebars-lang/handlebars.js/blob/55e4d9d80d5dd834fcf53c528e7e0aa080f315a5/lib/handlebars/base.js#L214

instance.registerHelper('lookup', function(obj, field) {
  if (!obj) {
    return obj;
  }
  if (field === 'constructor' && !obj.propertyIsEnumerable(field)) {
    return undefined;
  }
  return obj[field];
});

Related links:

Found by @itszn13.


≤3.0.8 | CVE-2015-8861

<any> @any ⏱️ func-parameter

Related links:

Found by @Matias P. Brutti.


Source | History