Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is this library safe agains mysql injections? #51

Open
DonatelloDonini opened this issue Jul 10, 2024 · 0 comments
Open

Is this library safe agains mysql injections? #51

DonatelloDonini opened this issue Jul 10, 2024 · 0 comments

Comments

@DonatelloDonini
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant