Skip to content

Commit 0563606

Browse files
committed
JS: Accept some suboptimal alert locations
Not perfect alert locations, but not important enough to fix right now
1 parent 1b8fa20 commit 0563606

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

javascript/ql/test/query-tests/Security/CWE-614/tst-cleartextCookie.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ app.get('/a', function (req, res, next) {
66
{
77
maxAge: 9000000000,
88
httpOnly: true,
9-
secure: false // $ Alert
10-
});
9+
secure: false
10+
}); // $ Alert
1111
res.end('ok')
1212
})
1313

1414
app.get('/b', function (req, res, next) {
1515
let options = {
1616
maxAge: 9000000000,
1717
httpOnly: true,
18-
secure: false // $ Alert
18+
secure: false
1919
}
20-
res.cookie('authKey', 'value', options);
20+
res.cookie('authKey', 'value', options); // $ Alert
2121
res.end('ok')
2222
})
2323

@@ -106,24 +106,24 @@ const session = require('express-session')
106106

107107
app.use(session({
108108
secret: 'secret',
109-
cookie: { secure: false } // $ Alert
110-
}))
109+
cookie: { secure: false }
110+
})) // $ Alert
111111

112112
app.use(session({
113113
secret: 'secret'
114114
})) // $ Alert
115115

116116
app.use(session({
117117
secret: 'secret',
118-
cookie: {} // $ Alert
119-
}))
118+
cookie: {}
119+
})) // $ Alert
120120

121121
const sess = {
122122
secret: 'secret',
123-
cookie: { secure: false } // $ Alert
123+
cookie: { secure: false }
124124
}
125125

126-
app.use(session(sess))
126+
app.use(session(sess)) // $ Alert
127127

128128

129129
app.set('trust proxy', 1)
@@ -150,12 +150,12 @@ app.use(session({
150150
app.use(session({
151151
name: 'session',
152152
keys: ['key1', 'key2'],
153-
secure: false, // $ Alert
153+
secure: false,
154154
httpOnly: true,
155155
domain: 'example.com',
156156
path: 'foo/bar',
157157
expires: expiryDate
158-
}))
158+
})) // $ Alert
159159

160160
http.createServer((req, res) => {
161161
res.setHeader('Content-Type', 'text/html');

0 commit comments

Comments
 (0)