Conversation
remove duckdb ref
Hi there 👋
The PR disables SQL expressions to remediate CVE-2024-9264 (RCE/LFI) and removes the DuckDB dependency. The security behavior is correct: SQL expressions are unconditionally disabled in all three gates (reader.go, nodes.go/sql_command.go, and the stub DB layer), and no bypass was found. The removal of the DuckDB import and go.mod entry is complete. However, the implementation introduces several maintainability and security-adjacent concerns that should be cleaned up before merge: the toggle-gating function in reader.go contains dead code with semantically inverted logic that could mislead future contributors into re-enabling the vulnerable path; the stub DB methods lack explanatory comments about why they are disabled; parser.go retains dead DuckDB serialization scaffolding; and there is an unreachable branch in sql_command.go. The documentation checklist item remains unchecked, and the feature toggle is now effectively ignored. These issues are non-blocking for the security fix itself but are recommended for change before final approval. These might need a close look
Worth checking
Small things (take or leave)
✅ Feature-level checklistLooks good
Partially covered
Review time: 7m 45s |
What is this feature?
Remove reference to DuckDB
Why do we need this feature?
See the blog post describing the vulnerability, for which a fix was rolled out to all Grafana versions earlier today:
https://grafana.com/blog/2024/10/17/grafana-security-release-critical-severity-fix-for-cve-2024-9264/
The full extent of our documentation around this feature seems to be here:
https://github.com/grafana/grafana/pull/81666/files#diff-16fb71b28e5b6197615abba8a07bc73d9bf75ebc60311663e1c29976de5cc9a6
All we've documented is that the feature-flag exists. That flag still exists in the codebase, so I'm tempted not to touch that documentation for now. We can always follow up with more improvements after this PR.
Who is this feature for?
Everyone
Which issue(s) does this PR fix?:
This moves the security fix into Grafana repo itself, now that it has been publicly announced. We need this here so we can clean up and simplify our Security-releases pipeline once again.
Special notes for your reviewer:
Please check that:
Behaviour of this patch was already verified manually by @toddtreece. See his confirmation of this on our private slack, here
Tested again on the Ephemeral instance here: https://ephemeral1511182194942samjewe.grafana-dev.net/d/be18gem24w2dcf/test-sql-expressions-bugfix?from=now-1h&to=now&timezone=browser