Skip to content

Commit

Permalink
Merge pull request #3314 from rhelmer/sanitize-jsonp
Browse files Browse the repository at this point in the history
better sanitize jsonp
  • Loading branch information
JohnMcLear committed Jan 31, 2018
2 parents d7c93b0 + f56936c commit 626e58c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/node/hooks/express/apicalls.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var apiCaller = function(req, res, fields) {
apiLogger.info("RESPONSE, " + req.params.func + ", " + response);

//is this a jsonp call, if yes, add the function call
if(req.query.jsonp)
if(req.query.jsonp && isVarName(response))
response = req.query.jsonp + "(" + response + ")";

res._____send(response);
Expand Down
3 changes: 2 additions & 1 deletion src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
"jsonminify" : "0.4.1",
"measured" : "1.1.0",
"mocha" : "2.4.5",
"supertest" : "1.2.0"
"supertest" : "1.2.0",
"is-var-name" : "1.0.0"
},
"bin": { "etherpad-lite": "./node/server.js" },
"devDependencies": {
Expand Down

0 comments on commit 626e58c

Please sign in to comment.