-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/sonar demo #112
base: master
Are you sure you want to change the base?
Feat/sonar demo #112
Conversation
This reverts commit a349cd0.
* feat: add prototype pollution exploit in typeorm * fix: container and db setup
Sarif/checking scanning flow
sarif: testing scanning flow with sarif file
Create snyk-test-sarif.yml
sarif: testing of workflows
sarif: test on merge
Update sarif.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SnykCode found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
Quality Gate failedFailed conditions See analysis details on SonarCloud Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
console.log(`User logged in: ${username}`) | ||
|
||
if (redirectPage) { | ||
return res.redirect(redirectPage) |
Check failure
Code scanning / SonarCloud
HTTP request redirections should not be open to forging attacks High
app.use(session({ | ||
secret: 'keyboard cat', | ||
name: 'connect.sid', | ||
cookie: { path: '/' } | ||
})) |
Check failure
Code scanning / CodeQL
Missing CSRF middleware High
request handler
cons.dust.helpers = dustHelpers; | ||
app.set('views', path.join(__dirname, 'views')); | ||
app.set('view engine', 'ejs'); | ||
app.use(logger('dev')); | ||
app.use(methodOverride()); | ||
app.use(cookieParser()); | ||
app.use(session({ | ||
secret: 'keyboard cat', |
Check failure
Code scanning / CodeQL
Hard-coded credentials Critical
key
// You know password for the user. | ||
{name: 'user', password: 'pwd'}, | ||
// You don't know password for the admin. | ||
{name: 'admin', password: Math.random().toString(32), canDelete: true}, |
Check failure
Code scanning / CodeQL
Insecure randomness High
Math.random()
// You don't know password for the admin. | ||
{name: 'admin', password: Math.random().toString(32), canDelete: true}, | ||
{ name: 'admin', password: Math.random().toString(32), canDelete: true }, |
Check failure
Code scanning / CodeQL
Insecure randomness High
Math.random()
console.log(`User logged in: ${username}`) | ||
|
||
if (redirectPage) { | ||
return res.redirect(redirectPage) |
Check warning
Code scanning / CodeQL
Server-side URL redirect Medium
user-provided value
@@ -14,6 +14,7 @@ | |||
<center>password</center> | |||
<input class="input" type="password" name="password" /> | |||
<center> | |||
<input type="hidden" name="redirectPage" value="<%- redirectPage %>" /> |
Check failure
Code scanning / CodeQL
Client-side cross-site scripting High
user-provided value
profile.lastname = validator.rtrim(profile.lastname) | ||
|
||
// render the view | ||
return res.render('account.hbs', profile) |
Check failure
Code scanning / CodeQL
Template Object Injection Critical
user-provided value
subhead: 'Vulnerabilities at their best', | ||
todos: todos, | ||
}); | ||
}); | ||
}; | ||
|
||
exports.loginHandler = function (req, res, next) { | ||
if (validator.isEmail(req.body.username)) { | ||
User.find({ username: req.body.username, password: req.body.password }, function (err, users) { |
Check failure
Code scanning / CodeQL
Database query built from user-controlled sources High
user-provided value
This query object depends on a
user-provided value
app.get('/admin', routes.admin); | ||
app.post('/admin', routes.admin); | ||
app.get('/login', routes.login); | ||
app.post('/login', routes.loginHandler); |
Check failure
Code scanning / CodeQL
Missing rate limiting High
a database access
@@ -79,7 +154,7 @@ | |||
|
|||
var item = req.body.content; | |||
var imgRegex = /\!\[alt text\]\((http.*)\s\".*/; | |||
if (typeof(item) == 'string' && item.match(imgRegex)) { | |||
if (typeof (item) == 'string' && item.match(imgRegex)) { |
Check failure
Code scanning / CodeQL
Polynomial regular expression used on uncontrolled data High
Creating issue for failing quality gate