This repository was archived by the owner on Oct 29, 2025. It is now read-only.
Security fix#59
Merged
Merged
Conversation
…= 0) its didn't use the standard size. It now uses the allowed size
Updates were made to the UpdateBuilder class in the MariaDB SQL builder. Changes include introducing measures for preventing SQL injection attacks by modifying how values are validated and executed. The code now supports both raw SQL execution and proper parameter binding, thus enhancing the security against injection threats.
The provided commit removes the 'allow_injection' feature and instead consistently uses parameterized queries for all SQL generation in the codebase. This change simplifies the code and provides a more reliable protection against SQL injection attacks. Modifications were made in the way conditions are handled to support these changes.
The unnecessary function `_transform_value_valid` has been removed from the base builder module. The execution method in the insert builder has been refactored; it now uses a list of values for execute, thus improving code readability and maintainability. This new approach avoids hardcoding values directly into the SQL query, enhancing security by mitigating potential SQL injection vulnerability.
In the mariadb_sqlbuilder package, the 'cursor.execute()' function in various builders is now updated to include 'self.values_for_execute'. This change aids the execution of SQL queries with values to be inputted at runtime. Furthermore, unnecessary value transformation functionality is removed in the UpsertBuilder to streamline operations.
The version of MariaDB-SQLBuilder was updated from 1.0.1 to 1.1. Keywords in the setup file were also modified, with 'orm' removed. A security fix was applied to prevent SQL injections by ensuring variables are given directly to the cursor instead of being written into SQL. This adjustment modifies the function “get_sql()” and introduces “values_for_execute” to manage variables.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.