Closed PB2204 closed 11 months ago
Title: Address Security and Input Validation Issues
Description:
This pull request addresses several security and input validation issues in the Flask application. The following changes have been made:
Introduced an validate_input function to sanitize user inputs by stripping leading and trailing spaces.
validate_input
Replaced query.filter_by(id=id) with query.get(id) to prevent SQL injection vulnerabilities when retrieving records by their primary key.
query.filter_by(id=id)
query.get(id)
Modified the delete route to use the HTTP POST method for secure deletion.
delete
Applied input validation consistently to all user inputs to prevent potential security vulnerabilities.
Enhanced the search route to check if the search query is not empty before performing the search and validated the input.
search
Included comments and improved code readability.
These changes improve the overall security and reliability of the application.
Files Affected:
app.py
Testing:
Checklist:
Thank You so much for your contribution. You made some amazing changes and you explained things pretty well.
Title: Address Security and Input Validation Issues
Description:
This pull request addresses several security and input validation issues in the Flask application. The following changes have been made:
Introduced an
validate_input
function to sanitize user inputs by stripping leading and trailing spaces.Replaced
query.filter_by(id=id)
withquery.get(id)
to prevent SQL injection vulnerabilities when retrieving records by their primary key.Modified the
delete
route to use the HTTP POST method for secure deletion.Applied input validation consistently to all user inputs to prevent potential security vulnerabilities.
Enhanced the
search
route to check if the search query is not empty before performing the search and validated the input.Included comments and improved code readability.
These changes improve the overall security and reliability of the application.
Files Affected:
app.py
: Modified to implement the mentioned changes.Testing:
Checklist: