Skip to content

Is this library safe agains mysql injections? #51

Open
@DonatelloDonini

Description

@DonatelloDonini

Is it a security concern if I use the following approach to get data from my database?

    def execute_query(self, query: str) -> list:
            """
            Execute a query on the database and return the result.
    
            Args:
              query (str): The query to execute.
    
            Returns:
              list: The result of the query.
            """
            cursor = self.mysql.connection.cursor()
            cursor.execute(query)
            result = cursor.fetchall()
            cursor.close()
            return result

If it's not safe can anyone suggest a better way to interact with my MySQL server with flask?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions