Skip to content

ECOPROJECT-4724 | fix: Escape SQL string fields in query builder to prevent second-order SQL injection#1231

Merged
AvielSegev merged 1 commit into
kubev2v:mainfrom
AvielSegev:ECOPROJECT-4724-fix-sql-injection
Jun 8, 2026
Merged

ECOPROJECT-4724 | fix: Escape SQL string fields in query builder to prevent second-order SQL injection#1231
AvielSegev merged 1 commit into
kubev2v:mainfrom
AvielSegev:ECOPROJECT-4724-fix-sql-injection

Conversation

@AvielSegev

@AvielSegev AvielSegev commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Cluster names from user-uploaded RVTools spreadsheets were interpolated
unescaped into ~27 DuckDB query templates via text/template, allowing
single-quote breakout and arbitrary SQL execution (e.g. read_text() for
file exfiltration). Apply escapeSQLString() to all user-controlled
queryParams fields (ClusterFilter, OSFilter, PowerStateFilter, VmIDFilter,
Category) before template execution.

@AvielSegev AvielSegev requested a review from a team as a code owner June 8, 2026 11:07
@AvielSegev AvielSegev requested review from ronenav and tupyy and removed request for a team June 8, 2026 11:07
…revent second-order SQL injection

Cluster names from user-uploaded RVTools spreadsheets were interpolated
unescaped into ~27 DuckDB query templates via text/template, allowing
single-quote breakout and arbitrary SQL execution (e.g. read_text() for
file exfiltration). Apply escapeSQLString() to all user-controlled
queryParams fields (ClusterFilter, OSFilter, PowerStateFilter, VmIDFilter,
Category) before template execution.

Signed-off-by: Aviel Segev <asegev@redhat.com>
@AvielSegev AvielSegev force-pushed the ECOPROJECT-4724-fix-sql-injection branch from 05a70bd to b2c241c Compare June 8, 2026 11:07
@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@AvielSegev, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 57 minutes and 15 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 28c828e0-b586-47bf-a9a6-effc660c530e

📥 Commits

Reviewing files that changed from the base of the PR and between db4c785 and b2c241c.

📒 Files selected for processing (1)
  • pkg/duckdb_parser/builder.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci Bot added the lgtm label Jun 8, 2026
@openshift-ci

openshift-ci Bot commented Jun 8, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tupyy

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved label Jun 8, 2026
@AvielSegev AvielSegev merged commit 6110711 into kubev2v:main Jun 8, 2026
14 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants