Summary
Apache Airflow's public Import Errors API can disclose raw parse-failure stack traces to users who have the ImportError.can_read permission, even when they should not be able to view details about the affected file. The traces may reveal file paths and code when a file has no registered DAGs.
Affected context
The issue occurs in Apache Airflow's public Import Errors API when a file's parse error remains but the file has no registered DAG. This can happen if parsing fails before a DAG is defined, or if all previously registered DAGs have been removed while the error remains. In these cases, the API returns the raw stack trace to users with ImportError.can_read, rather than requiring the more restrictive permission intended for viewing all import errors.
Exploit preconditions
- Attack surface: Apache Airflow's public Import Errors API
- Required access: An account with the
ImportError.can_readpermission - Trigger point: Reading an import error for a file with no registered DAG
- Why exposure is possible: Authorization does not sufficiently restrict access to the stack trace when no DAG is associated with the failing file
Why this happens
The API's authorization logic does not consistently apply the appropriate access control to raw parse-failure details. When a failing file has no registered DAG, the response exposes its stack trace to a user with a general import-error read permission. This is an authorization flaw mapped to CWE-285: Improper Authorization: access to sensitive information is not adequately checked against the intended permission boundary.
Potential impact
- Stack traces may disclose internal file paths or code
- An attacker with the required permission could learn details about application structure
- Exposed information could help inform further attacks
General mitigation guidance
Mitigation generally focuses on enforcing authorization at the point where sensitive error details are returned.
Common defensive patterns include:
- Require a narrowly scoped permission to view raw stack traces
- Apply the same access checks whether or not a file has a registered DAG
- Return sanitized error summaries to users without elevated access
- Follow least-privilege principles when assigning API permissions
- Test authorization behavior across missing, removed, and successfully registered resources
How teams detect issues like this
Teams can review API handlers and authorization policies for cases where access checks depend on resource-registration state.
- Use static analysis or code review to find sensitive response fields returned without an explicit permission check
- Test API responses for users with different permission levels and for files with no associated DAG
- Use policy tests to verify that stack traces are visible only to appropriately authorized roles
- Monitor access to import-error details and investigate unexpected retrieval patterns

