Commit 084f282
fix(interfaces): validate WHERE clause column names in UQI filtering (#42224)
## 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.
- Quote characters in column identifiers are escaped in the generated
filter expression.
Advisory:
[GHSA-cm7r-f7h3-q33p](https://github.com/appsmithorg/appsmith/security/advisories/GHSA-cm7r-f7h3-q33p)
Part of https://linear.app/appsmith/issue/APP-15874
## Testing
- [x] Server unit tests
New tests in `FilterDataServiceTest`:
- `testWhereWithUnknownColumn_throwsException`
- `testWhereWithUnknownColumnInNestedGroup_throwsException`
- `testWhereWithColumnNameContainingQuote_throwsException`
- `testWhereWithKnownColumn_filtersRows`
- `testGenerateLogicalExpression_quotesColumnNameContainingQuote`
## Impact on existing instances
- Working queries: no change.
- A WHERE condition on a column that isn't in the data already failed;
it now fails before the query is built, with `<column> not found in the
known column names`, instead of an in-memory database error.
- Rollback: restores the previous behavior.
## Automation
/ok-to-test tags="@tag.All"
## Communication
- [x] No
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- This is an auto-generated comment: Cypress test results -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/34604046075>
> Commit: 5633f15
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=34604046075&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Fri, 11 Sep 2026 14:25:05 UTC
<!-- end of auto-generated comment: Cypress test results -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Filtering now rejects conditions that reference unknown or invalid
column paths.
* Nested `AND` and `OR` conditions are validated consistently.
* Column names containing quotation marks are handled safely when
generating filter queries.
* Valid filters continue to work as expected.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>1 parent 179453b commit 084f282
2 files changed
Lines changed: 93 additions & 2 deletions
File tree
- app/server/appsmith-interfaces/src
- main/java/com/appsmith/external/services/ce
- test/java/com/appsmith/external/services
Lines changed: 28 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| 147 | + | |
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
| |||
867 | 868 | | |
868 | 869 | | |
869 | 870 | | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
870 | 895 | | |
871 | 896 | | |
872 | 897 | | |
| |||
898 | 923 | | |
899 | 924 | | |
900 | 925 | | |
| 926 | + | |
901 | 927 | | |
902 | 928 | | |
903 | | - | |
| 929 | + | |
904 | 930 | | |
905 | 931 | | |
906 | 932 | | |
| |||
926 | 952 | | |
927 | 953 | | |
928 | 954 | | |
929 | | - | |
| 955 | + | |
930 | 956 | | |
931 | 957 | | |
932 | 958 | | |
| |||
Lines changed: 65 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
1504 | 1505 | | |
1505 | 1506 | | |
1506 | 1507 | | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
1507 | 1572 | | |
0 commit comments