Skip to content

🔒 Fix SQL injection vulnerability in DuckDB execute - #35

Draft
devdudumuniz wants to merge 1 commit into
mainfrom
fix/sql-injection-client-456115586314976520
Draft

🔒 Fix SQL injection vulnerability in DuckDB execute#35
devdudumuniz wants to merge 1 commit into
mainfrom
fix/sql-injection-client-456115586314976520

Conversation

@devdudumuniz

Copy link
Copy Markdown
Owner

🎯 What:
Fixed a critical SQL injection vulnerability in pysus/api/client.py. The read_parquet function dynamically built SQL queries using f-strings for user-provided paths (e.g., f"SELECT * FROM '{path}'").

⚠️ Risk:
If left unfixed, this allowed an attacker to inject arbitrary SQL statements by providing carefully crafted file paths. Given this operates on DuckDB, it could allow arbitrary operations.

🛡️ Solution:
Refactored the query generation logic to safely use DuckDB's parameterized statements ($1 placeholder). Since DuckDB accepts list arrays for read_parquet and binds them securely natively, paths are now provided in the parameters argument of duckdb.execute(). We also cleaned up branching logic since single files and multi-files can now share the same array parameterization logic safely.


PR created automatically by Jules for task 456115586314976520 started by @devdudumuniz

Refactored PySUS DuckDB query building to use safe parameterization ($1)
when passing arbitrary strings as file paths. Instead of using f-strings
to place paths into queries, paths are now passed securely to execute().
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant