Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Security] SQL Injection Vulnerability in datasets and tasks routers

オープン
#281 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
20/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python, sql

調査の方向性

src/routers/openml/datasets.py と src/routers/openml/tasks.py から始め、その後 feature/sql-parameterization ブランチにある既存の修正を確認してください。ユーザー入力がパラメーター化されたプレースホルダーを使用していること、また動的なテーブル名やカラム名がホワイトリストに制限されていることを検証してください。報告された SQL injection の経路によってクエリ構造を変更できなければ完了です。

索引モデルが issue の本文から書いたものです。

説明

bug triage
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:

  1. Send a request to the /datasets/list endpoint.
  2. Provide a tag parameter containing malicious SQL syntax, for example:
    'study_14'); DROP TABLE dataset; --
  3. Result: The server concatenates this string directly into the query, which would attempt to drop the dataset table.
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.py
  • src/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 はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

openml/server-api のほかの issue

openml/server-api の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。