Skip to content

Python: Aiopg.qll misses some SQL injection sinks in aiopg #20111

@MagicXiaoBai1

Description

@MagicXiaoBai1

When analyzing Python code for potential SQL injection vulnerabilities using CodeQL, I noticed that some sink points related to aiopg are not recognized within the current CodeQL library.

import asyncio
import aiopg

DB_CONFIG = {
    "user": "your_user",
    "database": "your_database",
    "host": "127.0.0.1",
    "password": "your_password",
    "port": 5432
}

async def connect_and_query():
    async with aiopg.create_pool(**DB_CONFIG) as pool:
        async with pool.acquire() as conn:
            async with conn.cursor() as cursor:
                await cursor.execute("SELECT * FROM your_table")     # sink point !
                result = await cursor.fetchall()
                print("Query Result:", result)

The issue seems to originate from the Aiopg.qll file (python/ql/lib/semmle/python/frameworks/Aiopg.qll). I want to update this file to fix this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy