apache / apache/airflow

Avoid possible SQL injection by refactoring string-based query construction

Open
#34,252 2 comments 1 reaction 1 assignee Claimed by @hussein-awala View on GitHub
kind:meta
Dominant language
Python
Stars
46.9k
Forks
17.8k
Avg merge
2d 7h
Merged PRs (30d)
484

Description

### Body

Some of our queries are string based, and they are passed directly to sqlalchemy `session.execute()`. To avoid SQL injection, we can profit from sqlalchemy by rewriting the queries [bind parameters syntax](https://docs.sqlalchemy.org/en/14/core/sqlelement.html#sqlalchemy.sql.expression.text) or the select API.

- [ ] Airflow Core - migration
- [ ] Airflow Core - utils
- [ ] Airflow Providers - Amazon
- [ ] Airflow Providers - Apache.Cassandra
- [ ] Airflow Providers - Apache.Hive
- [ ] Airflow Providers - common.sql
- [ ] Airflow Providers - Databricks
- [ ] Airflow Providers - Google
- [ ] Airflow Providers - MySQL
- [ ] Airflow Providers - Oracle
- [ ] Airflow Providers - Postgres
- [ ] Airflow Providers - SalesForce

### Committer

- [X] I acknowledge that I am a maintainer/committer of the Apache Airflow project.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.