org.mvnpm:handlebars@4.7.9

  • 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)