[Security] SQL Injection Vulnerability in datasets and tasks routers
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 20/100
調査の方向性
src/routers/openml/datasets.py と src/routers/openml/tasks.py から始め、その後 feature/sql-parameterization ブランチにある既存の修正を確認してください。ユーザー入力がパラメーター化されたプレースホルダーを使用していること、また動的なテーブル名やカラム名がホワイトリストに制限されていることを検証してください。報告された SQL injection の経路によってクエリ構造を変更できなければ完了です。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
A critical security vulnerability was identified in the list_datasets and task lookup functions within the routers. The application was using raw string concatenation (f-strings) to build SQL queries from user-provided input.
This creates a high-risk SQL Injection (SQLi) vulnerability, allowing a malicious user to manipulate the query structure and execute unauthorized database commands, leading to potential data loss or unauthorized access.
To Reproduce
Steps to reproduce the behavior:
- Send a request to the
/datasets/listendpoint. - Provide a
tagparameter containing malicious SQL syntax, for example:
'study_14'); DROP TABLE dataset; -- - Result: The server concatenates this string directly into the query, which would attempt to drop the
datasettable.
Expected behavior
User input must always be treated as data, never as part of the SQL command structure. All database interactions should:
- Use parameterized placeholders (Bind Parameters).
- Strictly validate any dynamic table or column names against a predefined whitelist.
Additional context
This vulnerability was found in the following files:
src/routers/openml/datasets.pysrc/routers/openml/tasks.py
Status: A fix has already been implemented in the branch feature/sql-parameterization and is ready for review.
- 主要言語
- Python
- スター
- 16
- フォーク
- 50
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
openml/server-api のほかの issue
-
behavior
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
openml/server-api#337 · コメント 1 件 ·
-
proposal
openml/server-api#375 · コメント 2 件 · 担当者 1 名 ·
-
openml/server-api#374 · コメント 2 件 · 担当者 1 名 ·
-
openml/server-api#373 · 担当者 1 名 ·
-
openml/server-api#372 · 担当者 1 名 ·
openml/server-api の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
browser-use/browser-use#5905 ·
-
type: enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
ynput/ayon-python-api#363 ·
-
bug needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
modelscope/FunASR#3728 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
open-compass/opencompass#2655 ·