mirror of
https://github.com/github/codeql.git
synced 2025-12-17 09:13:20 +01:00
We happen to flag the condition with different-kinds-comparison-bypass. The ConditionalBypass query was originally intended to flag this I think, but doesn't anymore.
24 lines
664 B
JavaScript
24 lines
664 B
JavaScript
var express = require('express');
|
|
var app = express();
|
|
// ...
|
|
app.get('/full-profile/:userId', function(req, res) {
|
|
|
|
if (req.cookies.loggedInUserId !== req.params.userId) { // $ Alert[js/different-kinds-comparison-bypass]
|
|
requireLogin(); // $ MISSING: Alert - login decision made based on user controlled data
|
|
} else {
|
|
// ... show private information
|
|
}
|
|
|
|
});
|
|
|
|
app.get('/full-profile/:userId', function(req, res) {
|
|
|
|
if (req.signedCookies.loggedInUserId !== req.params.userId) {
|
|
// OK - login decision made based on server controlled data
|
|
requireLogin();
|
|
} else {
|
|
// ... show private information
|
|
}
|
|
|
|
});
|