Skip to content

Commit 872b6d8

Browse files
committed
Added test case for CreatePreparedStatementCommand
1 parent b89e70b commit 872b6d8

File tree

1 file changed

+15
-2
lines changed
  • javascript/ql/test/query-tests/Security/CWE-089/untyped

1 file changed

+15
-2
lines changed

javascript/ql/test/query-tests/Security/CWE-089/untyped/athena.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { AthenaClient, StartQueryExecutionCommand, CreateNamedQueryCommand, UpdateNamedQueryCommand } = require("@aws-sdk/client-athena");
1+
const { AthenaClient, StartQueryExecutionCommand, CreateNamedQueryCommand, UpdateNamedQueryCommand, CreatePreparedStatementCommand } = require("@aws-sdk/client-athena");
22
const AWS = require('aws-sdk');
33
const express = require('express');
44
const bodyParser = require('body-parser');
@@ -10,7 +10,7 @@ app.post('/v3/athena/all', async (req, res) => {
1010

1111
const client = new AthenaClient({ region: "us-east-1" });
1212

13-
const params1 = {
13+
const params1 = {
1414
QueryString: "SQL" + userQuery,
1515
QueryExecutionContext: { Database: "default" },
1616
ResultConfiguration: { OutputLocation: "s3://my-results/" }
@@ -70,3 +70,16 @@ app.post('/v2/athena/all', async (req, res) => {
7070

7171
res.end();
7272
});
73+
74+
app.post('/dynamodb-v3', async (req, res) => {
75+
const userQueryStatement = req.body.query; // $ MISSING: Source
76+
const client = new AthenaClient({ region: "us-east-1" });
77+
const input = {
78+
StatementName: "STRING_VALUE",
79+
WorkGroup: "STRING_VALUE",
80+
QueryStatement: userQueryStatement,
81+
Description: "STRING_VALUE",
82+
};
83+
const command = new CreatePreparedStatementCommand(input);
84+
await client.send(command); // $ MISSING: Alert
85+
});

0 commit comments

Comments
 (0)