Merge pull request +7970 from c9/fix-javascript-token

Make sure generated tokens are never valid JavaScript
pull/117/merge
Lennart Kats 2015-06-25 14:13:45 +02:00
commit a65656baee
1 zmienionych plików z 4 dodań i 1 usunięć

5
node_modules/c9/uid.js wygenerowano vendored
Wyświetl plik

@ -8,5 +8,8 @@ module.exports = function(length) {
.toString("base64")
.replace(/[^a-zA-Z0-9]/g, "");
}
return uid.slice(0, length);
// HACK: make sure unique id is never syntactically valid JavaScript
// See http://balpha.de/2013/02/plain-text-considered-harmful-a-cross-domain-exploit/
uid = "9c" +uid.slice(0, length - 2);
return uid;
};