Repository navigation
bug: upgrade hbs 4.0.4 -> 4.2.1 to fix handlebars prototype pollution (SNYK-JS-HANDLEBARS-173692) - #1122
Open
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
… (SNYK-JS-HANDLEBARS-173692) hbs@4.0.4 pulled in handlebars@4.0.14, which lets templates reach __proto__ / __defineGetter__ / constructor and can lead to RCE (SNYK-JS-HANDLEBARS-173692, fixed in handlebars 4.1.2). hbs 4.2.1 pins handlebars 4.7.9, which also covers SNYK-JS-HANDLEBARS-534988 and CVE-2026-33937/33938/33939/33941. Finding: sfind-6f90225278874a7c9039f0106de1de1e Co-Authored-By: Hannah Huh <hannah.huh@cognition.ai> Signed-off-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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.
Problem
package.jsonpinnedhbs@^4.0.4, which resolveshandlebars@4.0.14. That version lets a template reach__proto__/__defineGetter__/constructoron the context object (SNYK-JS-HANDLEBARS-173692, CWE-1321, CVSS 7.3), which can escalate to arbitrary code execution on the server. The hbs engine rendersviews/layout.hbsandviews/account.hbs(app.js:26,routes/index.js).Fix
Bump
hbsto4.2.1(the smallest hbs that pinshandlebars@4.7.9, well above the 4.1.2 fix line) plus the matchingpackage-lock.json. Lockfile-only change otherwise; no application code touched, so the committedsarif.jsonline anchors are unaffected.Also clears, on the hbs path: SNYK-JS-HANDLEBARS-534988, SNYK-JS-HANDLEBARS-480388, SNYK-JS-HANDLEBARS-1056767 and CVE-2026-33937/33938/33939/33941. The dev-only
tap@11 > nyc@11 > istanbul-reports > handlebars@4.0.11path is bundled by nyc and needs a separate tap major bump.Verification (offline — api.snyk.io and the Snyk CLI are blocked in this environment, so no rescan)
npm ciin a worktree of this branch resolveshbs@4.2.1/handlebars@4.7.9.Prototype-access PoC (
node poc.js <checkout> <label>):Render smoke test with the real
app.js(in-memory Mongo stand-in): login,GET /account_detailsand a legitPOST /account_detailsall render the normal layout with the submitted values intact on 4.7.9.Note: the separate client-controlled
layoutparameter traversal on/account_detailsis not fixed by this upgrade (tracked by sfind-e36d42c4 / #1106).Finding:
sfind-6f90225278874a7c9039f0106de1de1ePer org policy this new finding gets its own PR; it duplicates the earlier hbs bumps (#642, #717, #742, #875) and only one should land.
Devin-Org: engineering
Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/758e23ba61e74661a9eae26d025c3bed
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/758e23ba61e74661a9eae26d025c3bed?variant=devin
Devin Review