-
Notifications
You must be signed in to change notification settings - Fork 2
Separate CAP from non-CAP alerts #96
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
Conversation
const { book, quantity } = req2.params.category | ||
const LOG = cds.log("nodejs"); | ||
LOG.info("CAP:" + book); // CAP log injection alert from non-CAP source | ||
console.log("console:" + book); // non-CAP Log injection alert from non-CAP source |
Check warning
Code scanning / CodeQL
Log injection
this.on ('submitOrder', async req => { | ||
const {book,quantity} = req.data | ||
const LOG = cds.log("nodejs"); | ||
LOG.info("CAP:" + book); // CAP log injection alert |
Check warning
Code scanning / CodeQL
CAP Log injection
this.on('format', (req) => { | ||
const cds2 = require('@sap/cds/lib') | ||
const LOG = cds2.log('cds.log') | ||
const $ = req.data; LOG.info('format:', $) // CAP log injection alert |
Check warning
Code scanning / CodeQL
CAP Log injection
app.get("search", function handler(req2, res) { | ||
const { book, quantity } = req2.params.category | ||
const LOG = cds.log("nodejs"); | ||
LOG.info("CAP:" + book); // CAP log injection alert from non-CAP source |
Check warning
Code scanning / CodeQL
CAP Log injection
|
||
const app = require("express")(); | ||
app.get("search", function handler(req2, res) { | ||
pool.query(req2.params.category, [], function (err, results) { // non-CQL injection alert from non-CAP source |
Check failure
Code scanning / CodeQL
Database query built from user-controlled sources
app.get("search", function handler(req2, res) { | ||
pool.query(req2.params.category, [], function (err, results) { // non-CQL injection alert from non-CAP source | ||
// process results | ||
}); | ||
}); |
Check failure
Code scanning / CodeQL
Missing rate limiting
let { stock } = await SELECT`stock`.from(Books, book) | ||
|
||
let query = SELECT.from`Books`.where(`ID=${book}`) | ||
let books = await cds.db.run(query) // CQL injection alert |
Check failure
Code scanning / CodeQL
CQL query built from user-controlled sources
let query = SELECT.from`Books`.where(`ID=${book}`) | ||
let books = await cds.db.run(query) // CQL injection alert | ||
|
||
let books11 = await SELECT.from`Books`.where(`ID=${book}`) // CQL injection alert |
Check failure
Code scanning / CodeQL
CQL query built from user-controlled sources
let books11 = await SELECT.from`Books`.where(`ID=${book}`) // CQL injection alert | ||
|
||
let query2 = SELECT.from`Books`.where('ID=' + book) | ||
let books2 = await cds.db.run(query2) // CQL injection alert |
Check failure
Code scanning / CodeQL
CQL query built from user-controlled sources
let query2 = SELECT.from`Books`.where('ID=' + book) | ||
let books2 = await cds.db.run(query2) // CQL injection alert | ||
|
||
let books22 = await SELECT.from`Books`.where('ID=' + book) // CQL injection alert |
Check failure
Code scanning / CodeQL
CQL query built from user-controlled sources
let books33 = await SELECT.from`Books`.where('ID=' + id) //safe | ||
|
||
let cqn = CQL`SELECT col1, col2, col3 from Books` + book | ||
let books222 = await cds.db.run(cqn) // CQL injection alert |
Check failure
Code scanning / CodeQL
CQL query built from user-controlled sources
let books222 = await cds.db.run(cqn) // CQL injection alert | ||
|
||
let cqn1 = cds.parse.cql(`SELECT * from Books` + book) | ||
let books111 = await cds.db.run(cqn1) // CQL injection alert |
Check failure
Code scanning / CodeQL
CQL query built from user-controlled sources
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.
LGTM
Closes #95