Repository navigation
FOUR-34303 SQLi /api/1.0/processes/{process}/aggregation - #9130
devmiguelangel wants to merge 10 commits into
Conversation
…rocessController and Process model
PR SummaryMedium Risk Overview Adds shared Reviewed by Cursor Bugbot for commit 96d1fd9. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6b2ccfa. Configure here.
…rsion models to support legacy data
|
QA server K8S was successfully deployed https://tenant-1.ci-cab54a1756.engk8s.processmaker.net |
|
QA server K8S was successfully deployed https://tenant-1.ci-cab54a1756.engk8s.processmaker.net |
|





Issue & Reproduction Steps
SQLi /api/1.0/processes/{process}/aggregation
processes.aggregationwas stored with no validation and later interpolated intoProcess::getProcessStageCounts():A user who can create processes could save a value that closed the string literal and injected SQL into the SELECT list. The query ran on
GET /api/1.0/processes/{process}/stage-mapping. The same column is also mass-assignable on process create, update, and import.Solution
getProcessStageCounts()and fall back toamountwhen the stored value is not a variable name.AggregationVariable(Process::rules(),saveAggregation) and theHasAggregationAttributemutator onProcessandProcessVersion, which also covers import.JsonDataPath.BaseFilternow builds its JSON path through the same helper.How to Test
./vendor/bin/phpunit 'tests/Feature/Api/ProcessControllerTest.php'./vendor/bin/phpunit 'tests/Feature/ImportExport/Exporters/ProcessExporterTest.php'./vendor/bin/phpunit 'tests/unit/ProcessMaker/FilterTest.php'./vendor/bin/phpunit 'tests/unit/ProcessMaker/Support/JsonDataPathTest.php'./vendor/bin/phpunit 'tests/unit/ProcessMaker/Rules/AggregationVariableTest.php'Related Tickets & Packages
FOUR-34303
Code Review Checklist
ci:deploy