[Security] SQL Injection Vulnerability in datasets and tasks routers
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 20/100
Research direction
Start with src/routers/openml/datasets.py and src/routers/openml/tasks.py, then review the existing fix in the feature/sql-parameterization branch. Verify that user input uses parameterized placeholders and that dynamic table or column names are restricted to a whitelist; done means the reported SQL injection paths cannot alter query structure.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Python
- Stars
- 16
- Forks
- 50
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openml/server-api
-
behavior
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
openml/server-api#337 · 1 comment ·
-
proposal
openml/server-api#375 · 2 comments · 1 assignee ·
-
openml/server-api#374 · 2 comments · 1 assignee ·
-
openml/server-api#373 · 1 assignee ·
-
openml/server-api#372 · 1 assignee ·
All issues in openml/server-api
Similar issues
-
area: harness bug status: needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Human-Agent-Society/reef#625 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 1/5 Under an hour Newbie friendliness 80/100
learningequality/kolibri#15351 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Name consistency Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
eellak/triplestore#65 · 1 comment ·