org.mvnpm:handlebars@4.7.8

  • latest version

    4.7.10

  • latest non vulnerable version

  • first published

    1 years ago

  • latest version published

    1 months ago

  • licenses detected

  • package registry

  • Direct Vulnerabilities

    Known vulnerabilities in the org.mvnpm:handlebars package. This does not include vulnerabilities belonging to this package’s dependencies.

    Fix vulnerabilities automatically

    Snyk's AI Trust Platform automatically finds the best upgrade path and integrates with your development workflows. Secure your code at zero cost.

    Fix for free
    VulnerabilityVulnerable Version
    • C
    Access of Resource Using Incompatible Type ('Type Confusion')

    org.mvnpm:handlebars is an extension to the Mustache templating language.

    Affected versions of this package are vulnerable to Access of Resource Using Incompatible Type ('Type Confusion') via the compiler's handling of pre-parsed AST objects passed to compile or precompile. When a caller supplies a hand-built or attacker-influenced AST directly to the compiler, AST node values such as path depths, path parts, literal values, content strings, hash pair keys, and block params are written into generated JavaScript code without sufficient validation, allowing an attacker to inject arbitrary code into the compiled template output. The fix moves all AST value validation into the compiler itself, so that values are checked at the point they are written into generated code rather than only at parse time.

    How to fix Access of Resource Using Incompatible Type ('Type Confusion')?

    Upgrade org.mvnpm:handlebars to version 4.7.10 or higher.

    [4.7.8,4.7.10)
    • M
    Cross-site Scripting (XSS)

    org.mvnpm:handlebars is an extension to the Mustache templating language.

    Affected versions of this package are vulnerable to Cross-site Scripting (XSS) in the quotedString() function in lib/handlebars/compiler/code-gen.js, which writes static template text into the JavaScript that Handlebars.precompile() generates without neutralizing a </script> sequence. An attacker can execute script in the browser under the embedding page's origin by placing </script> followed by markup in a template, which closes the script element early so the remainder is parsed as HTML. This requires the application to precompile templates the attacker controls and to embed the generated source directly in an inline <script> element, and the injected markup runs only when a user loads that page.

    How to fix Cross-site Scripting (XSS)?

    Upgrade org.mvnpm:handlebars to version 4.7.10 or higher.

    [,4.7.10)
    • C
    Incomplete List of Disallowed Inputs

    org.mvnpm:handlebars is an extension to the Mustache templating language.

    Affected versions of this package are vulnerable to Incomplete List of Disallowed Inputs in the lookupProperty function in lib/handlebars/runtime.js, which returns the resolved value as soon as Object.prototype.hasOwnProperty.call(parent, propertyName) holds, without consulting the prototype access deny list, and constructor is an own property of every prototype object, so Function.prototype.constructor resolves to Function itself. An attacker can execute code on the server by rendering a template that walks to a prototype and reads its constructor, as in {{lookup (lookup fn "__proto__") "constructor"}}. This requires the attacker to control the template rather than only the data, and compilation with allowProtoMethodsByDefault: true.

    How to fix Incomplete List of Disallowed Inputs?

    Upgrade org.mvnpm:handlebars to version 4.7.10 or higher.

    [4.7.8,4.7.10)
    • M
    Prototype Pollution

    org.mvnpm:handlebars is an extension to the Mustache templating language.

    Affected versions of this package are vulnerable to Prototype Pollution in the protoAccessControl function. An attacker can gain unauthorized access to prototype methods by referencing __lookupSetter__ in templates through untrusted input.

    Note: This is only exploitable if the allowProtoMethodsByDefault option is set to true.

    How to fix Prototype Pollution?

    Upgrade org.mvnpm:handlebars to version 4.7.9 or higher.

    [4.7.8,4.7.9)
    • M
    Time-of-check Time-of-use (TOCTOU) Race Condition

    org.mvnpm:handlebars is an extension to the Mustache templating language.

    Affected versions of this package are vulnerable to Time-of-check Time-of-use (TOCTOU) Race Condition in the lookup function. An attacker can access properties that should be restricted by bypassing prototype-access controls through a time-of-check time-of-use (TOCTOU) flaw, where the security check and the actual property access are decoupled.

    Note: This is only exploitable if the { compat: true } compile option is enabled.

    How to fix Time-of-check Time-of-use (TOCTOU) Race Condition?

    Upgrade org.mvnpm:handlebars to version 4.7.9 or higher.

    [4.7.8,4.7.9)
    • H
    Improper Check for Unusual or Exceptional Conditions

    org.mvnpm:handlebars is an extension to the Mustache templating language.

    Affected versions of this package are vulnerable to Improper Check for Unusual or Exceptional Conditions through the registerDecorator path in lib/handlebars/compiler/javascript-compiler.js. An attacker can crash the Node.js process by supplying a template with malformed or unregistered decorator syntax, causing the compiled template to call an undefined decorator as a function. This affects applications that compile untrusted templates at request time, especially when the compile/render call is not wrapped in try/catch. A single malicious template such as {{*n}} can trigger an unhandled TypeError and terminate the process.

    How to fix Improper Check for Unusual or Exceptional Conditions?

    Upgrade org.mvnpm:handlebars to version 4.7.9 or higher.

    [4.7.8,4.7.9)
    • H
    Improper Encoding or Escaping of Output

    org.mvnpm:handlebars is an extension to the Mustache templating language.

    Affected versions of this package are vulnerable to Improper Encoding or Escaping of Output through the CLI precompiler in lib/precompiler.js. An attacker can execute arbitrary JavaScript in the generated bundle by supplying crafted template filenames or CLI options such as --namespace, --commonjs, --handlebarPath, or --map. The issue affects the precompiler output path used by bin/handlebars / lib/precompiler.js, where untrusted names and option values were concatenated into emitted JavaScript without escaping.

    How to fix Improper Encoding or Escaping of Output?

    Upgrade org.mvnpm:handlebars to version 4.7.9 or higher.

    [4.7.8,4.7.9)
    • C
    Access of Resource Using Incompatible Type ('Type Confusion')

    org.mvnpm:handlebars is an extension to the Mustache templating language.

    Affected versions of this package are vulnerable to Access of Resource Using Incompatible Type ('Type Confusion') via the resolvePartial and invokePartial functions. An attacker can execute arbitrary code on the server by supplying a crafted object as a dynamic partial in the template context, which is then compiled and executed as JavaScript.

    Note: This is only exploitable if the template uses dynamic partial lookups and the attacker can control the context property used for the lookup.

    How to fix Access of Resource Using Incompatible Type ('Type Confusion')?

    Upgrade org.mvnpm:handlebars to version 4.7.9 or higher.

    [4.7.8,4.7.9)
    • C
    Access of Resource Using Incompatible Type ('Type Confusion')

    org.mvnpm:handlebars is an extension to the Mustache templating language.

    Affected versions of this package are vulnerable to Access of Resource Using Incompatible Type ('Type Confusion') via the compile function. An attacker can execute arbitrary code by supplying a crafted Abstract Syntax Tree (AST) object with a malicious NumberLiteral value, which is emitted directly into generated JavaScript code without proper sanitization.

    Note: This allows the attacker to inject and run arbitrary commands on the server. This is only exploitable if user-controlled JSON is deserialized and passed directly to the compile function.

    How to fix Access of Resource Using Incompatible Type ('Type Confusion')?

    Upgrade org.mvnpm:handlebars to version 4.7.9 or higher.

    [4.7.8,4.7.9)
    • C
    Access of Resource Using Incompatible Type ('Type Confusion')

    org.mvnpm:handlebars is an extension to the Mustache templating language.

    Affected versions of this package are vulnerable to Access of Resource Using Incompatible Type ('Type Confusion') via manipulation of the @partial-block variable in the template data context. An attacker can execute arbitrary JavaScript code on the server by overwriting @partial-block with a crafted Handlebars AST and triggering its evaluation through a subsequent invocation.

    Note: This is only exploitable if helpers that accept arbitrary objects are registered and allow mutation of the data context.

    How to fix Access of Resource Using Incompatible Type ('Type Confusion')?

    Upgrade org.mvnpm:handlebars to version 4.7.9 or higher.

    [4.7.8,4.7.9)
    • L
    Prototype Pollution

    org.mvnpm:handlebars is an extension to the Mustache templating language.

    Affected versions of this package are vulnerable to Prototype Pollution via the resolvePartial function. An attacker can inject malicious scripts into rendered output by polluting Object.prototype with a key matching a partial reference, causing unescaped content to be rendered.

    Note:

    This is only exploitable if the attacker knows or can guess the name of a partial reference used in a template.

    How to fix Prototype Pollution?

    Upgrade org.mvnpm:handlebars to version 4.7.9 or higher.

    [4.7.8,4.7.9)