Straight Into The Page
An analytics assistant turns a question into SQL, runs it, and renders an explanation of the rows. Which of these let untrusted text reach somewhere it is executed or interpreted as code? More than one applies.
app.post('/ask', async (req, res) => {
const sql = await model.generateSQL(req.body.question);
const rows = await db.query(sql); // pool user: app_rw
const text = await model.explain(rows);
res.send(`<div class="answer">${text}</div>`);
});
Sign in to answer questions and track your progress
Sign In