fix: parameterise report SQL instead of formatting filters in - #77
Merged
aakvatech merged 18 commits intoSep 4, 2026
Merged
Conversation
# Conflicts: # .gitignore # propms/__init__.py # propms/auto_custom.py # propms/hooks.py # propms/issue_hook.py # propms/lease_invoice.py # propms/lease_invoice_schedule.py # propms/pos.js # propms/property_management_solution/doctype/lease/lease.py # propms/property_management_solution/doctype/property/property.py # propms/property_management_solution/report/invoice_details/other_methods.py # propms/property_management_solution/report/mis_income_break_up/other_methods.py # propms/property_management_solution/report/rent_invoices_details/rent_invoices_details.py # propms/property_management_solution/report/rent_invoices_details_usd/rent_invoices_details_usd.py # propms/property_management_solution/report/subscription_service_report/subscription_service_report.js # propms/property_management_solution/report/utility_invoices/other_methods.py # pyproject.toml
aakvatech
merged commit Sep 4, 2026
438e82d
into
Aakvatech-Limited:version-16-hotfix
3 of 4 checks passed
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Removes the six
frappe-sql-format-injectionfindings the Frappe semgrep rulesreport against propms. Report filter values reached raw SQL through string
formatting, so any user who can open the report can inject SQL.
rent_invoices_details.pycompany,from_date,to_date, and the invoice id used for the per-invoice item queryrent_invoices_details_usd.pyinvoice_details/other_methods.pyrentalfilter and the invoice name, concatenated into theWHEREclauseutility_invoices/other_methods.pyWHEREclauseEvery one now travels as a
%(name)sbind parameter. The only value stillconcatenated into a query string is the
conditionsfragment in the two rentreports, which is a constant literal chosen by an
if, never user input.The
print(query)debug statement in the Utility Invoices rate lookup is gonetoo.
semgrep --config frappe-semgrep-rules/rulesonpropms/goes from 6frappe-sql-format-injectionfindings to 0, and both reports still executeagainst the version-16 test site.
Depends on #76.