-
Notifications
You must be signed in to change notification settings - Fork 347
fix: Support JSON keys in dashboard filters #1271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 64c99be The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ec9365c to
7c44504
Compare
Pull Request Review: Support JSON Keys in Dashboard FiltersThis PR fixes an issue where dashboard filters fail when using JSON/Dynamic-type keys by wrapping filter keys with toString() in ClickHouse queries. Strengths
CRITICAL: SQL Injection Vulnerability (HIGH SEVERITY)The filtersToQuery function in searchFilters.tsx (lines 29-31, 37-39) is vulnerable to SQL injection. Values and keys are directly interpolated into SQL without escaping:
MUST FIX BEFORE MERGE: Add proper SQL escaping for both keys and values. Escape single quotes and backslashes at minimum. Other Issues
RecommendationsIMMEDIATE:
FUTURE:
VerdictDO NOT MERGE - Security issue must be fixed first. Core functionality is well-designed but needs proper input sanitization. |
7c44504 to
64c99be
Compare
E2E Test Results✅ All tests passed • 25 passed • 3 skipped • 229s
|
| <Tooltip withArrow label="Edit Filters" fz="xs" color="gray"> | ||
| <Button | ||
| variant="outline" | ||
| type="submit" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes another issue I noticed - hitting enter anywhere in the dashboard form would open the filters modal.
Closes HDX-2607
This PR fixes an error when filtering a dashboard with a JSON (or Dynamic-type) key.
Dynamictype values cannot be the LHS of theINoperator, sojson.key IN ('value')errors.To fix, dashboard filter keys are now stringified:
toString(json.key) IN ('value'). This fix is applied to all filter keys, regardless of their type, since filter values are always strings as well. The existing query parameter format is retained.Screen.Recording.2025-10-15.at.4.10.16.PM.mov