fix(interfaces): validate WHERE clause column names in UQI filtering - #42224
Conversation
Check every column referenced in a WHERE condition, including nested AND/OR groups, against the columns present in the data before building the filter query, and escape quote characters in column identifiers. GHSA: https://github.com/appsmithorg/appsmith/security/advisories/GHSA-cm7r-f7h3-q33p Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. WalkthroughThe filter service now validates condition column paths against the generated schema, including nested conditions. SQL generation escapes embedded double quotes. Tests cover invalid paths, valid filtering, plugin errors, and quote escaping. ChangesCondition filtering
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The filtering changes validate referenced columns before query execution and consistently escape quoted identifiers. No merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Columns stand checked before queries flow Comment |
Description
Hardens column handling in the WHERE clause of UQI in-memory filtering (used by the Google Sheets and Amazon S3 plugins).
FilterDataServiceCE.filterDataNew()checks every column referenced in the WHERE condition, including nested AND/OR groups, against the columns present in the data before building the query. Unknown columns return a validation error.Advisory: GHSA-cm7r-f7h3-q33p
Part of https://linear.app/appsmith/issue/APP-15874
Testing
New tests in
FilterDataServiceTest:testWhereWithUnknownColumn_throwsExceptiontestWhereWithUnknownColumnInNestedGroup_throwsExceptiontestWhereWithColumnNameContainingQuote_throwsExceptiontestWhereWithKnownColumn_filtersRowstestGenerateLogicalExpression_quotesColumnNameContainingQuoteImpact on existing instances
<column> not found in the known column names, instead of an in-memory database error.Automation
/ok-to-test tags="@tag.All"
Communication
🤖 Generated with Claude Code
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/34604046075
Commit: 5633f15
Cypress dashboard.
Tags:
@tag.AllSpec:
Fri, 11 Sep 2026 14:25:05 UTC
Summary by CodeRabbit
ANDandORconditions are validated consistently.