Fix: make /import/batch/approve work #11237
Merged
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.
Closes #11227
This commit ensures the
batch_id
value passed into the query is the same as the value ofbatch_id
as it is passed in from the endpoint.Previously, this value was always
1
. E.g., visiting/import/batch/approve/3
would show:Technical
This change in this commit was tested for SQL injection by setting
batch_id
to '3 OR true':It is not immediately obvious to me that is a sufficient test, and I am unsure if these queries are being parameterized if created this way.
Testing
Create a new import batch as a non-privileged user. Visit
/import/batch/<batch_id>
and click onApprove
. The batch status should change topending
.Screenshot
Stakeholders
@mekarpeles, @liz907.