{"action":"created","issue":{"url":"https://api.github.com/repos/krakenjs/kraken-devtools/issues/43","labels_url":"https://api.github.com/repos/krakenjs/kraken-devtools/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/krakenjs/kraken-devtools/issues/43/comments","events_url":"https://api.github.com/repos/krakenjs/kraken-devtools/issues/43/events","html_url":"https://github.com/krakenjs/kraken-devtools/issues/43","id":57700055,"number":43,"title":"Possible security issue","user":{"login":"kylekatarnls","id":5966783,"avatar_url":"https://avatars.githubusercontent.com/u/5966783?v=3","gravatar_id":"","url":"https://api.github.com/users/kylekatarnls","html_url":"https://github.com/kylekatarnls","followers_url":"https://api.github.com/users/kylekatarnls/followers","following_url":"https://api.github.com/users/kylekatarnls/following{/other_user}","gists_url":"https://api.github.com/users/kylekatarnls/gists{/gist_id}","starred_url":"https://api.github.com/users/kylekatarnls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kylekatarnls/subscriptions","organizations_url":"https://api.github.com/users/kylekatarnls/orgs","repos_url":"https://api.github.com/users/kylekatarnls/repos","events_url":"https://api.github.com/users/kylekatarnls/events{/privacy}","received_events_url":"https://api.github.com/users/kylekatarnls/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-02-14T17:33:11Z","updated_at":"2015-04-10T16:12:14Z","closed_at":null,"body":"If I try to load the URL `/anything.anything)`, I get this error:\r\n<pre>SyntaxError: Caught exception: Invalid regular expression: //(.*)\\.anything:)$/: Unmatched ')'\r\nSyntaxError: Caught exception: Invalid regular expression: //(.*)\\.anything:)$/: Unmatched ')'\r\n  at new RegExp (<anonymous>:null:null)\r\n  at start (node_modules/kraken-devtools/lib/middleware.js:45:21)\r\n  at fn (node_modules/kraken-devtools/node_modules/async/lib/async.js:582:34)\r\n  at Object._onImmediate (node_modules/kraken-devtools/node_modules/async/lib/async.js:498:34)\r\n  at processImmediate [as _immediateCallback] (timers.js:336:15)</pre>\r\n\r\nI see the code:\r\n<pre>ext = path.extname(req.path).replace('.', '\\\\.');\r\nregex = new RegExp(dir + '/(.*)' + ext +'$', 'i');</pre>\r\n\r\nInject the URL (user input) in a RegExp is a very bad idea IMHO."},"comment":{"url":"https://api.github.com/repos/krakenjs/kraken-devtools/issues/comments/91604621","html_url":"https://github.com/krakenjs/kraken-devtools/issues/43#issuecomment-91604621","issue_url":"https://api.github.com/repos/krakenjs/kraken-devtools/issues/43","id":91604621,"user":{"login":"jasisk","id":62923,"avatar_url":"https://avatars.githubusercontent.com/u/62923?v=3","gravatar_id":"","url":"https://api.github.com/users/jasisk","html_url":"https://github.com/jasisk","followers_url":"https://api.github.com/users/jasisk/followers","following_url":"https://api.github.com/users/jasisk/following{/other_user}","gists_url":"https://api.github.com/users/jasisk/gists{/gist_id}","starred_url":"https://api.github.com/users/jasisk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasisk/subscriptions","organizations_url":"https://api.github.com/users/jasisk/orgs","repos_url":"https://api.github.com/users/jasisk/repos","events_url":"https://api.github.com/users/jasisk/events{/privacy}","received_events_url":"https://api.github.com/users/jasisk/received_events","type":"User","site_admin":false},"created_at":"2015-04-10T16:12:14Z","updated_at":"2015-04-10T16:12:14Z","body":"@kylekatarnls ab02da0f1384a6aa840ed149798479bdef3e7824"}}