Skip to content

DAG Processing Processor attempts to parse PPTX (and other non-code based ZIP archives) based on zipfile.is_zipfile design #45718

Description

@mckenzie-andrew

Apache Airflow version

Other Airflow 2 version (please specify below)

If "Other Airflow 2 version" selected, which one?

2.10.3

What happened?

Dags Processing Manager attempts to parse PPTX files causing it to place corrupted data in the metadata database.

What you think should happen instead?

Ideally it should not be parsing any none-Python files from the /usr/local/airflow/dags directory.

How to reproduce

Copy text from an Airflow DAG code and place it inside a PPTX slide. Upload the PPTX to /usr/local/airflow/dags, wait for errors to appear in dags processing manager logs (may take little bit of time), for reference I have attached what I used and screenshot:

Image

Testing AIrflow Bug.pptx

Operating System

Amazon Linux 2023

Versions of Apache Airflow Providers

Connection type Package
AWS Connection apache-airflow-providers-amazon[aiobotocore]==9.0.0
Postgres Connection apache-airflow-providers-postgres==5.13.1
FTP Connection apache-airflow-providers-ftp==3.11.1
Fab Connection apache-airflow-providers-fab==1.5.0
Celery Connection apache-airflow-providers-celery==3.8.3
HTTP Connection apache-airflow-providers-http==4.13.2
IMAP Connection apache-airflow-providers-imap==3.7.0
Common SQL apache-airflow-providers-common-sql==1.19.0
SQLite Connection apache-airflow-providers-sqlite==3.9.0
SMTP Connection apache-airflow-providers-smtp==1.8.0

Deployment

Amazon (AWS) MWAA

Deployment details

Nothing special, default MWAA deployment no additional configurations or requirements.

Anything else?

Based on how zipfile works --> https://github.com/apache/airflow/blob/main/airflow/utils/file.py#L276

It appears the list of items that could be parsed extends beyond PPTX [1]

Hex signature ISO 8859-1 Offset Extension Description
50 4B 03 04, 50 4B 05 06 (empty archive), 50 4B 07 08 (spanned archive) PK␃␄,PK␅␆,PK␇␈ 0 zip, aar, apk, docx, epub, ipa, jar, kmz, maff, msix, odp, ods, odt, pk3, pk4, pptx, usdz, vsdx, xlsx, xpi zip file format and formats based on it, such as EPUB, JAR, ODF, OOXML

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions