Baracchino-Della-Scuola / Bot

Audit required: Risk of possible SQL injection vector through string-based query construction BAN-B608
Security
Major
5 months ago2 years old
Possible SQL injection vector through string-based query construction.
43    @tag.command(name="add", aliases=["create"], description="Create a tag")
44    async def add(self, ctx, name, *, content):
45        cur = await self.bot.connection.cursor()
46        await cur.execute(f"INSERT into tags VALUES ('{name}', '{content}')")47        await ctx.send(f"Tag {name} has been created.")
48
49
Possible SQL injection vector through string-based query construction.
29            await ctx.send(embed=emb)
30        else:
31            print("OOOOF")
32            await cur.execute(f"SELECT * from tags WHERE name = '{name}'")33            data = await cur.fetchall()
34            for a in data:
35                emb = discord.Embed(
Possible SQL injection vector through string-based query construction.
 88    @commands.command()
 89    async def warnings(self, ctx, user: discord.User):
 90        cur = await self.bot.connection.cursor()
 91        await cur.execute(f"SELECT * from warns WHERE user = '{user.id}'") 92        r = await cur.fetchall()
 93        warns = ""
 94        for a in r:
Possible SQL injection vector through string-based query construction.
 81        cur = await self.bot.connection.cursor()
 82        print(reason)
 83        await cur.execute(
 84            f"INSERT into warns (user, reason, moderator) VALUES ('{user.id}', '{' '.join(list(reason))}', '{ctx.author.id}')" 85        )
 86        await ctx.send("I warned " + str(user))
 87
Possible SQL injection vector through string-based query construction.
 60        elif payload.emoji.name == "🔒":
 61            ch = channel
 62            cur = await self.bot.connection.cursor()
 63            await cur.execute(f"SELECT * from tickets WHERE ch = '{ch.id}'") 64            r = await cur.fetchall()
 65            print(r)
 66            try: