chore: update dependency handlebars to v4.7.9 [security] - autoclosed#714
Closed
renovate[bot] wants to merge 1 commit intomasterfrom
Closed
chore: update dependency handlebars to v4.7.9 [security] - autoclosed#714renovate[bot] wants to merge 1 commit intomasterfrom
renovate[bot] wants to merge 1 commit intomasterfrom
Conversation
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
3cf9e37 to
227435a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
4.7.8→4.7.9GitHub Vulnerability Alerts
GHSA-442j-39wm-28r2
Summary
In
lib/handlebars/runtime.js, thecontainer.lookup()function usescontainer.lookupProperty()as a gate check to enforce prototype-access controls, but then discards the validated result and performs a second, unguarded property access (depths[i][name]). This Time-of-Check Time-of-Use (TOCTOU) pattern means the security check and the actual read are decoupled, and the raw access bypasses any sanitization thatlookupPropertymay perform.Only relevant when the compat compile option is enabled (
{compat: true}), which activatesdepthedLookupinlib/handlebars/compiler/javascript-compiler.js.Description
The vulnerable code in
lib/handlebars/runtime.js(lines 137–144):container.lookupProperty()(lines 119–136) enforceshasOwnPropertychecks andresultIsAllowed()prototype-access controls. However,container.lookup()only useslookupPropertyas a boolean gate — if the gate passes (result != null), it then performs an independent, rawdepths[i][name]access that circumvents any transformation or wrapped value thatlookupPropertymay have returned.Workarounds
{ compat: true }when rendering templates that include untrusted data.GHSA-7rx3-28cr-v5wh
Summary
The prototype method blocklist in
lib/handlebars/internal/proto-access.jsblocksconstructor,__defineGetter__,__defineSetter__, and__lookupGetter__, but omits the symmetric__lookupSetter__. This omission is only exploitable when the non-default runtime optionallowProtoMethodsByDefault: trueis explicitly set — in that configuration__lookupSetter__becomes accessible while its counterparts remain blocked, creating an inconsistent security boundary.4.6.0is the version that introducedprotoAccessControland theallowProtoMethodsByDefaultruntime option.Description
In
lib/handlebars/internal/proto-access.js:All four legacy accessor helpers (
__defineGetter__,__defineSetter__,__lookupGetter__,__lookupSetter__) were involved in the exploit chain addressed by CVE-2021-23383. Three of the four were explicitly blocked;__lookupSetter__was left out.When
allowProtoMethodsByDefault: trueis set, any prototype method not present inmethodWhiteListis permitted by default. Because__lookupSetter__is absent from the list, it passes thecheckWhiteListcheck and is accessible in templates, while__lookupGetter__(its sibling) is correctly denied.Workarounds
allowProtoMethodsByDefault: true. The default configuration is not affected.allowProtoMethodsByDefaultmust be enabled, ensure templates do not reference__lookupSetter__through untrusted input.Release Notes
handlebars-lang/handlebars.js (handlebars)
v4.7.9Compare Source
e0137c2eab1d14hashto be aRecord<string, any>-de4414d4512766e497a3568d8df5Commits
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.