Skip to content

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
mainfrom
devin/sfind-6f902252-handlebars-prototype-pollution
Open

devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/sfind-6f902252-handlebars-prototype-pollution

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Problem

package.json pinned hbs@^4.0.4, which resolves handlebars@4.0.14. That version lets a template reach __proto__ / __defineGetter__ / constructor on 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 renders views/layout.hbs and views/account.hbs (app.js:26, routes/index.js).

Fix

Bump hbs to 4.2.1 (the smallest hbs that pins handlebars@4.7.9, well above the 4.1.2 fix line) plus the matching package-lock.json. Lockfile-only change otherwise; no application code touched, so the committed sarif.json line 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.11 path 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 ci in a worktree of this branch resolves hbs@4.2.1 / handlebars@4.7.9.

Prototype-access PoC (node poc.js <checkout> <label>):

== [main] handlebars 4.0.14
VULNERABLE __defineGetter__ access: "function __defineGetter__() { [native code] }"
== [fix] handlebars 4.7.9
blocked    __defineGetter__ access: ""
Handlebars: Access has been denied to resolve the property "split" because it is not an "own property" of its parent.

Render smoke test with the real app.js (in-memory Mongo stand-in): login, GET /account_details and a legit POST /account_details all render the normal layout with the submitted values intact on 4.7.9.

Note: the separate client-controlled layout parameter traversal on /account_details is not fixed by this upgrade (tracked by sfind-e36d42c4 / #1106).

Finding: sfind-6f90225278874a7c9039f0106de1de1e

Per 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

Status Commit
⚪ Not started —

Run Devin Review

Enable auto-review to review your pull requests automatically.

Devin Review (Staging)


Devin Review

… (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>
@devin-ai-integration

Copy link
Copy Markdown
Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedhbs@​4.0.4 ⏵ 4.2.11009910087 -4100

View full report

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants