Use a query parameter for the subscription run flag - #285
Conversation
The run-flag statements interpolated the id straight into the SQL. It was not exploitable, the value is an int, but it is the pattern SAST tools flag as SQL injection. Bind it as a parameter instead, and add the missing tests.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (8)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: simplify9/coderabbit/.coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: simplify9/coderabbit/.coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📜 Recent review details🔇 Additional comments (2)
📝 SummaryWhat changed
Riskrisk:low Security-sensitive areas
Test coverage impact
Operational concerns
WalkthroughChangesRun Flag Safety
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to Run-flag updates now bind subscription IDs as SQL parameters while retaining claim, idle, reclaim, and subscription-isolation behavior. The change is covered by integration tests and is ready to merge. Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
RunFlagUpdaterinstead of interpolating it into the SQL, which also drops the bogus quotes around an integer.RunFlagUpdaterTests, this code had no coverage.Not exploitable (the value is a C#
int), but it is the pattern SAST tools flag as SQL injection, and it makes our written answer on the security assessment accurate.Verified: integration suite 73/73 passes, and the EF command log shows
WHERE id = @p0with the value bound separately.