Skip to content

Commit

Permalink
Merge pull request #4 from n8n-io/n8n-3776-expressions-xss-part-2
Browse files Browse the repository at this point in the history
N8N-3776-expressions-xss-part-2
  • Loading branch information
ivov authored Jun 8, 2022
2 parents 63f7f8f + 6b06b42 commit 37cbae9
Show file tree
Hide file tree
Showing 7 changed files with 6,774 additions and 29 deletions.
3 changes: 3 additions & 0 deletions dist/csp.tmpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -7547,6 +7547,8 @@ var tmpl = (function () {

if (expr.slice(0, 11) !== 'try{return ') expr = 'return ' + expr;

expr = 'var ' + (typeof window !== 'object' ? 'global' : 'window') + ' = {}; ' + expr;

return safeEval.func('E', expr + ';')
}

Expand Down Expand Up @@ -7640,6 +7642,7 @@ var tmpl = (function () {
expr = !cnt ? _wrapExpr(expr, asText)
: cnt > 1 ? '[' + list.join(',') + '].join(" ").trim()' : list[0];
}

return expr

function skipBraces (ch, re) {
Expand Down
3 changes: 3 additions & 0 deletions dist/es6.tmpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,8 @@ var tmpl = (function () {

if (expr.slice(0, 11) !== 'try{return ') expr = 'return ' + expr

expr = 'var ' + (typeof window !== 'object' ? 'global' : 'window') + ' = {}; ' + expr

return new Function('E', expr + ';') // eslint-disable-line no-new-func
}

Expand Down Expand Up @@ -470,6 +472,7 @@ var tmpl = (function () {
expr = !cnt ? _wrapExpr(expr, asText)
: cnt > 1 ? '[' + list.join(',') + '].join(" ").trim()' : list[0]
}

return expr

function skipBraces (ch, re) {
Expand Down
3 changes: 3 additions & 0 deletions dist/tmpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@

if (expr.slice(0, 11) !== 'try{return ') expr = 'return ' + expr

expr = 'var ' + (typeof window !== 'object' ? 'global' : 'window') + ' = {}; ' + expr

return new Function('E', expr + ';') // eslint-disable-line no-new-func
}

Expand Down Expand Up @@ -465,6 +467,7 @@
expr = !cnt ? _wrapExpr(expr, asText)
: cnt > 1 ? '[' + list.join(',') + '].join(" ").trim()' : list[0]
}

return expr

function skipBraces (ch, re) {
Expand Down
Loading

0 comments on commit 37cbae9

Please sign in to comment.