Skip to content

Commit

Permalink
Fix potential security issue by ensuring that idToSessionMap.hasOwnPr…
Browse files Browse the repository at this point in the history
…operty(sessionId)
  • Loading branch information
MaxNanasy committed Nov 18, 2012
1 parent 181a120 commit e568357
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pick-a-number-node/server.js
Expand Up @@ -34,7 +34,7 @@ http.createServer(function (request, response) {
urlParse = url.parse(request.url, true);
var
sessionId = cookies.get('sessionId'),
session = sessionId && idToSessionMap[sessionId];
session = idToSessionMap.hasOwnProperty(sessionId) && idToSessionMap[sessionId];
switch (urlParse.pathname) {
case '/':
response.writeOnlyHead(httpStatus.FOUND, { 'Location': 'game/' });
Expand Down

0 comments on commit e568357

Please sign in to comment.