Skip to content
Access control Disclosed report Beginner

Apache Airflow: Bypass permission verification to read code of other dags

An authenticated user could access the source code of a DAG they were not authorised to view, bypassing permission checks.

timon8 Follow

Originally disclosed on HackerOne

Bounty$540 Low View original
  • Triaged in 5 days
  • Fixed in 26 days
  • Paid in 26 days
  • Disclosed after 41 days

Summary by the program

CVE-2023-50944: Apache Airflow: Bypass permission verification to read code of other dags Severity: low

Affected versions: Apache Airflow before 2.8.1

Description: Apache Airflow, versions before 2.8.1, have a vulnerability that allows an authenticated user to access the source code of a DAG to which they don't have access. This vulnerability is considered low since it requires an authenticated user to exploit it. Users are recommended to upgrade to version 2.8.1, which fixes this issue.

Credit: Timon8 Zhang (finder)

Full Security Advisory: https://lists.apache.org/thread/92krb5mpcq8qrw4t4j5oooqw7hgd8q7h

The report

Apache Airflow, versions before 2.8.1, have a vulnerability that allows an authenticated user to access the source code of a DAG to which they don't have access. This vulnerability is considered low since it requires an authenticated user to exploit it. Users are recommended to upgrade to version 2.8.1, which fixes this issue.

Email form the project maintainer ██████████

Impact

Apache Airflow<2.8.1

The original report as published on HackerOne, by timon8. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 3 min read.

Context

Apache Airflow is a workflow orchestration platform in which pipelines are defined as DAGs (directed acyclic graphs) written in Python. The Airflow web interface lets authenticated users browse DAGs, inspect their runs and, among other things, view the source code of a DAG. Access to individual DAGs is governed by Airflow's permission model, so a user who has been granted access to some DAGs should not be able to see the code of DAGs they have not been granted access to.

The report covers CVE-2023-50944, described by the program as a bypass of permission verification that allows reading the code of other DAGs. It was filed against the Apache Airflow repository under the Internet Bug Bounty program, rated low severity, and a bounty of 540.00 USD was awarded. The weakness is classified as improper access control (generic). The report was disclosed on 2024-03-12.

Setup

The precondition stated in the advisory is an authenticated user. The vulnerability is considered low precisely because exploitation requires an authenticated account. No specific role, configuration, tooling or test environment is described in the report.

Affected versions are Apache Airflow before 2.8.1. The fixed version is 2.8.1.

Finding it

The report itself is short: it states that versions before 2.8.1 allow an authenticated user to access the source code of a DAG to which they do not have access. The report does not describe the observation or reasoning that led to the discovery, and it does not include the request or response that demonstrates the bypass. What is clear from the advisory is the mismatch between the intended behaviour (DAG source code is only visible to users with access to that DAG) and the actual behaviour (an authenticated user without access can still read it).

Exploitation

The report does not publish a step-by-step exploitation sequence, and no request, payload or command is reproduced in it. The only exploitation detail given is the condition: the attacker must be authenticated, and from that position they can reach the source code of a DAG they are not authorised to view. The report does not state which endpoint, parameter or header is involved.

Root cause

The report does not analyse the code path responsible. What can be said from the advisory is that the permission check protecting DAG source code could be bypassed by an authenticated user, so the authorisation decision for that view was not enforced correctly. The specific mistake in the code is not described in the report.

Impact

An authenticated user can read the source code of DAGs they have not been granted access to. The program rates this low, because an account is required.

Fix

Upgrading to Apache Airflow 2.8.1 fixes the issue, and that is the recommendation given to users.

Variants to test

The report gives no endpoint detail, so the concrete variants below are generic directions rather than reproductions of this bug:

  1. Compare the source-code view of a DAG you can access with the same view for a DAG you cannot. A positive result is the second view returning the DAG's Python source instead of an authorisation error.
  2. Try the same DAG identifier through different routes that render source, such as the UI page and any API or raw-file endpoint the product exposes. A positive result is any route that returns source without the permission check.
  3. Test whether the check is applied to the DAG identifier as supplied or to a normalised form of it, for example by varying case or encoding. A positive result is a request that passes the check but resolves to a DAG you cannot access.

Hunting notes

This class of bug tends to sit in secondary views of an object: the main listing is protected, but a detail, download or raw-content route reuses the object identifier without repeating the authorisation check. During recon, look for products with per-object permissions and several ways to render the same object, and for views that return file contents or code.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 9 min read.

What happened, in plain words

Apache Airflow is a tool that runs and schedules data pipelines. Each pipeline is written as a small Python program called a DAG. Airflow has a web interface where people log in and look at these pipelines: what they do, when they ran, and what their code looks like.

Airflow also has a permission system. An administrator can say that a particular person may see some pipelines but not others. The idea is simple: if you are not allowed to see a pipeline, you should not be able to read its code either.

This report is about a bug where that rule did not hold. A person who had logged in, but who had not been given access to a particular DAG, could still read the source code of that DAG. The bug is tracked as CVE-2023-50944. It was reported against the Apache Airflow project through the Internet Bug Bounty program, rated low severity, and a bounty of 540.00 USD was paid. The weakness is classified as improper access control. It was disclosed on 2024-03-12.

The report itself is very short. It says what the bug allows and which versions are affected, and it recommends upgrading. It does not show the request that triggers the bug, the page involved, or the code that is at fault. So this article explains the concepts behind the bug and what the advisory does and does not tell us, rather than walking through a reproduction.

Context

What Airflow is

Apache Airflow is a workflow orchestration platform. That phrase means it is software that decides when jobs should run, starts them, watches them, and records what happened. The jobs are grouped into pipelines, and each pipeline is defined as a DAG, a directed acyclic graph. A graph here is just a set of steps with arrows between them, and acyclic means the arrows never loop back on themselves, so the pipeline always moves forward and finishes.

DAGs are written in Python. That matters for this bug: the definition of a pipeline is literally source code, and Airflow's web interface can show that source code to the people using it.

What the web interface does

The Airflow web interface is a website served by the Airflow installation. Once you log in, you can browse the list of DAGs, open one, look at its past runs, and view its source code. Think of it like a company intranet where each department has its own folder: you log in once, and then you can open the folders you have been given.

The permission model

Access to individual DAGs is governed by Airflow's permission model. An administrator grants a user access to some DAGs. The intended behaviour is that a user who has been granted access to some DAGs should not be able to see the code of DAGs they have not been granted access to.

A useful comparison is a shared office building. Your badge opens the doors you are allowed through. The security rule is not just that the main entrance checks your badge, but that every door does. If one side door opens without a check, the whole system is weaker than it looks.

The report at a glance

The report covers CVE-2023-50944, described by the program as a bypass of permission verification that allows reading the code of other DAGs. It was filed against the Apache Airflow repository under the Internet Bug Bounty program, rated low severity, and a bounty of 540.00 USD was awarded. The weakness is classified as improper access control (generic). The report was disclosed on 2024-03-12.

Setup

The precondition stated in the advisory is an authenticated user. Authenticated means the person has a valid account and has logged in. The vulnerability is considered low precisely because exploitation requires an authenticated account: an anonymous visitor on the internet cannot use it.

No specific role, configuration, tooling or test environment is described in the report. In other words, the advisory does not say whether the user needs to be an ordinary viewer, an editor, or anything else, and it does not describe how the researcher set up a test instance.

Affected versions are Apache Airflow before 2.8.1. The fixed version is 2.8.1.

Finding it

The report itself is short: it states that versions before 2.8.1 allow an authenticated user to access the source code of a DAG to which they do not have access.

There is no screenshot, no URL, and no payload in the text.

What is clear from the advisory is the mismatch between two things:

  1. The intended behaviour: DAG source code is only visible to users with access to that DAG.
  2. The actual behaviour: an authenticated user without access can still read it.

That gap between what the software promises and what it does is the heart of an access control bug. The feature exists and works for permitted users; the problem is that the check in front of it can be avoided.

Exploitation

The report does not publish a step-by-step exploitation sequence, and no request, payload or command is reproduced in it. The only exploitation detail given is the condition: the attacker must be authenticated, and from that position they can reach the source code of a DAG they are not authorised to view.

An endpoint is the specific address on a website that a request is sent to, for example the page that displays a DAG's code. A parameter is a piece of information attached to that address, such as an identifier saying which DAG you want. A header is extra information sent alongside a request, such as a cookie that proves you are logged in.

Because none of these are named, there is nothing to copy and replay here. What we can say is the shape of the attack: log in as a user with limited access, then ask the web interface for the code of a DAG that user was never granted, and receive the code instead of a refusal.

Root cause

The report does not analyse the code path responsible. What can be said from the advisory is that the permission check protecting DAG source code could be bypassed by an authenticated user, so the authorisation decision for that view was not enforced correctly.

Two terms are worth separating. Authentication is proving who you are, like showing your badge at the door. Authorisation is deciding what you are allowed to do once inside, like which rooms your badge opens. This bug is an authorisation failure: the person was correctly identified, but the decision about what they may read was not applied.

The specific mistake in the code is not described in the report.

Impact

An authenticated user can read the source code of DAGs they have not been granted access to. The program rates this low, because an account is required.

It is a read of code, as far as the advisory goes, and nothing more is claimed.

Fix

Upgrading to Apache Airflow 2.8.1 fixes the issue, and that is the recommendation given to users.

For anyone running Airflow, the practical action is the same as with most software fixes: check your version, and if it is older than 2.8.1, upgrade. The advisory also links to the full security advisory published by the Apache project.

Variants to test

The report gives no endpoint detail, so the concrete variants below are generic directions rather than reproductions of this bug:

  1. Compare the source-code view of a DAG you can access with the same view for a DAG you cannot. A positive result is the second view returning the DAG's Python source instead of an authorisation error.
  2. Try the same DAG identifier through different routes that render source, such as the UI page and any API or raw-file endpoint the product exposes. A positive result is any route that returns source without the permission check.
  3. Test whether the check is applied to the DAG identifier as supplied or to a normalised form of it, for example by varying case or encoding. A positive result is a request that passes the check but resolves to a DAG you cannot access.

An API is a way for one program to talk to another over the web, using addresses and structured replies instead of web pages meant for humans. A raw-file endpoint is one that returns a file's contents directly rather than a formatted page. Normalising an identifier means tidying it into a standard form, for example treating upper and lower case as the same thing. If the check looks at the tidied version but the lookup uses the original, the two can disagree, and that disagreement is exactly the kind of gap these tests look for.

Hunting notes

This class of bug tends to sit in secondary views of an object: the main listing is protected, but a detail, download or raw-content route reuses the object identifier without repeating the authorisation check. Going back to the office comparison, the front desk checks your badge, but the side door to the archive room does not.

During recon, look for products with per-object permissions and several ways to render the same object, and for views that return file contents or code. Recon here means the early survey work: learning what the product offers, which pages exist, and which of them show protected material.

Glossary

  • Access control: the rules that decide who may see or do what inside a system.
  • Advisory: an official notice from a software project describing a security problem and its fix.
  • Affected versions: the releases of the software that contain the bug.
  • API: a way for programs to exchange requests and structured replies over the web.
  • Authenticated user: a person who has logged in with a valid account.
  • Authentication: proving who you are, for example by logging in.
  • Authorisation: deciding what an identified person is allowed to do or see.
  • Bounty: a payment made by a program to someone who reports a valid security bug.
  • Bypass: getting past a check without satisfying it.
  • CVE: a public identifier given to a known security vulnerability so people can refer to it unambiguously.
  • DAG (directed acyclic graph): in Airflow, a pipeline defined as steps with arrows between them that never loop back.
  • Endpoint: a specific address on a web service that requests are sent to.
  • Header: extra information sent with a web request, such as a cookie proving you are logged in.
  • Improper access control: a weakness where the rules about who may access something are missing or can be avoided.
  • Normalisation: converting an identifier into a standard form, such as ignoring case, so equivalent inputs look the same.
  • Parameter: a piece of information attached to a request, such as which item you want to view.
  • Permission model: the overall design of who is allowed to access which parts of a system.
  • Raw-file endpoint: an address that returns a file's contents directly rather than a formatted page.
  • Recon: the early survey of a product to learn what it does and where its weak points might be.
  • Severity: a rating of how serious a vulnerability is, often low, medium, high or critical.
  • Source code: the human-written program text that defines how software behaves.
  • Workflow orchestration: software that schedules, starts and monitors a series of jobs.

More by timon8

View all

2 more disclosed reports, best first.

More from Internet Bug Bounty

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.