File tree 3 files changed +16
-1
lines changed
3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 19
19
"node-netstat" : " ^1.6.0" ,
20
20
"pem" : " ^1.14.1" ,
21
21
"promise.prototype.finally" : " ^3.1.0" ,
22
+ "safe-compare" : " ^1.1.4" ,
22
23
"ws" : " ^6.1.2" ,
23
24
"xhr2" : " ^0.1.4"
24
25
},
28
29
"@types/mime-types" : " ^2.1.0" ,
29
30
"@types/opn" : " ^5.1.0" ,
30
31
"@types/pem" : " ^1.9.4" ,
32
+ "@types/safe-compare" : " ^1.1.0" ,
31
33
"@types/ws" : " ^6.0.1" ,
32
34
"fs-extra" : " ^7.0.1" ,
33
35
"nexe" : " ^2.0.0-rc.34" ,
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import * as path from "path";
16
16
import * as pem from "pem" ;
17
17
import * as util from "util" ;
18
18
import * as ws from "ws" ;
19
+ import safeCompare = require( "safe-compare" ) ;
19
20
import { TunnelCloseCode } from "@coder/tunnel/src/common" ;
20
21
import { handle as handleTunnel } from "@coder/tunnel/src/server" ;
21
22
import { createPortScanner } from "./portScanner" ;
@@ -67,7 +68,7 @@ export const createApp = async (options: CreateAppOptions): Promise<{
67
68
68
69
// Try/catch placed here just in case
69
70
const cookies = parseCookies ( req ) ;
70
- if ( cookies . password && cookies . password === options . password ) {
71
+ if ( cookies . password && safeCompare ( cookies . password , options . password ) ) {
71
72
return true ;
72
73
}
73
74
} catch ( ex ) {
Original file line number Diff line number Diff line change 148
148
resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.3.tgz#7ee330ba7caafb98090bece86a5ee44115904c2c"
149
149
integrity sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA==
150
150
151
+ " @types/safe-compare@^1.1.0 " :
152
+ version "1.1.0"
153
+ resolved "https://registry.yarnpkg.com/@types/safe-compare/-/safe-compare-1.1.0.tgz#47ed9b9ca51a3a791b431cd59b28f47fa9bf1224"
154
+ integrity sha512-1ri+LJhh0gRxIa37IpGytdaW7yDEHeJniBSMD1BmitS07R1j63brcYCzry+l0WJvGdEKQNQ7DYXO2epgborWPw==
155
+
151
156
" @types/serve-static@* " :
152
157
version "1.13.2"
153
158
resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.13.2.tgz#f5ac4d7a6420a99a6a45af4719f4dcd8cd907a48"
@@ -3155,6 +3160,13 @@
[email protected] , safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2, s
3155
3160
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
3156
3161
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
3157
3162
3163
+ safe-compare@^1.1.4 :
3164
+ version "1.1.4"
3165
+ resolved "https://registry.yarnpkg.com/safe-compare/-/safe-compare-1.1.4.tgz#5e0128538a82820e2e9250cd78e45da6786ba593"
3166
+ integrity sha512-b9wZ986HHCo/HbKrRpBJb2kqXMK9CEWIE1egeEvZsYn69ay3kdfl9nG3RyOcR+jInTDf7a86WQ1d4VJX7goSSQ==
3167
+ dependencies :
3168
+ buffer-alloc "^1.2.0"
3169
+
3158
3170
safe-regex@^1.1.0 :
3159
3171
version "1.1.0"
3160
3172
resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e"
You can’t perform that action at this time.
0 commit comments